472,984 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,984 software developers and data experts.

Anyone using lotus notes automation classes

Joe
HI

Has anyone been able to work with lotus notes automation classes???

Can you post sample code of how to use these classes. I have setup in VB but
I am not able to port
to C# This is what I have so far - I cannot create a session and not sure
how to setup From/Subject
Thanks
object Session , DB , Memo, Item;

string Server, Mailfile, strSubject,strDest, strCopy, strFilename;

lotus.NOTESSESSION session;

lotus.NOTESDATABASE db;

lotus.NOTESDOCUMENT doc;

lotus.NOTESFORM form;

strSubject = "Test Memo sent at" + System.DateTime.Now.ToString();

strDest = so*****@yahoo.com;

strCopy = "Copyto";

//Session = createobject("Notes.NotesSession"); // Creates a Notes Session

//Type NotesSession = Type.GetTypeFromProgID("lotus.NOTESSESSION");

//session = (lotus.NOTESSESSION)Activator.CreateInstance(Notes Session);

Server = session.GETENVIRONMENTSTRING("MailServer", true); // Read the
current mail server from Notes.ini

Mailfile = session.GETENVIRONMENTSTRING("MailFile", true) ; // Read the
current mail file from Notes.ini

db = (lotus.NOTESDATABASE)session.GETDATABASE(Server, Mailfile,true); // Try
to open the mail Database


if (db == null)

{

MessageBox.Show( "Could not access Notes mail file!","",
MessageBoxButtons.OKCancel); // If Mail db not accessible, return an error

return;

}

doc = (lotus.NOTESDOCUMENT)db.CREATEDOCUMENT(); //Create a memo in the user
's mail file
//doc.Form = "Memo"; //Set the form to be a mail Memo

//doc.AUTHORS = session.USERNAME; //Set the from field (not necessary)

//doc.sendto = strDest; //Set the recipient of the Memo

//doc.copyto = strCopy;

//doc.subject = strSubject; //Give the memo a subject

strFilename = "Somefile.txt";

lotus.NOTESRICHTEXTITEM item =
(lotus.NOTESRICHTEXTITEM)doc.CREATERICHTEXTITEM("B ody");

item.EMBEDOBJECT(1454, "", strFilename,""); //Go to the body of the memo and
embed the attachement

doc.SAVE(0, 1,""); //Save the memo in drafts

doc.SEND(1,""); //Send the memo
Dec 15 '06 #1
1 12950
Joe,

Your code looks like it is a SMTP class lard with some special Notes
objects.

I would first look here in your case

http://www.systemnetmail.com/

Cor

"Joe" <hc******@yahoo.comschreef in bericht
news:%2***************@TK2MSFTNGP02.phx.gbl...
HI

Has anyone been able to work with lotus notes automation classes???

Can you post sample code of how to use these classes. I have setup in VB
but I am not able to port
to C# This is what I have so far - I cannot create a session and not sure
how to setup From/Subject
Thanks
object Session , DB , Memo, Item;

string Server, Mailfile, strSubject,strDest, strCopy, strFilename;

lotus.NOTESSESSION session;

lotus.NOTESDATABASE db;

lotus.NOTESDOCUMENT doc;

lotus.NOTESFORM form;

strSubject = "Test Memo sent at" + System.DateTime.Now.ToString();

strDest = so*****@yahoo.com;

strCopy = "Copyto";

//Session = createobject("Notes.NotesSession"); // Creates a Notes Session

//Type NotesSession = Type.GetTypeFromProgID("lotus.NOTESSESSION");

//session = (lotus.NOTESSESSION)Activator.CreateInstance(Notes Session);

Server = session.GETENVIRONMENTSTRING("MailServer", true); // Read the
current mail server from Notes.ini

Mailfile = session.GETENVIRONMENTSTRING("MailFile", true) ; // Read the
current mail file from Notes.ini

db = (lotus.NOTESDATABASE)session.GETDATABASE(Server, Mailfile,true); //
Try to open the mail Database


if (db == null)

{

MessageBox.Show( "Could not access Notes mail file!","",
MessageBoxButtons.OKCancel); // If Mail db not accessible, return an error

return;

}

doc = (lotus.NOTESDOCUMENT)db.CREATEDOCUMENT(); //Create a memo in the
user 's mail file
//doc.Form = "Memo"; //Set the form to be a mail Memo

//doc.AUTHORS = session.USERNAME; //Set the from field (not necessary)

//doc.sendto = strDest; //Set the recipient of the Memo

//doc.copyto = strCopy;

//doc.subject = strSubject; //Give the memo a subject

strFilename = "Somefile.txt";

lotus.NOTESRICHTEXTITEM item =
(lotus.NOTESRICHTEXTITEM)doc.CREATERICHTEXTITEM("B ody");

item.EMBEDOBJECT(1454, "", strFilename,""); //Go to the body of the memo
and embed the attachement

doc.SAVE(0, 1,""); //Save the memo in drafts

doc.SEND(1,""); //Send the memo


Dec 16 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Sateesh | last post by:
Hi, Is it possible to access Lotus notes using Python? Can anyone provide me some pointers? Thanks Sateesh
10
by: hrishy | last post by:
Hi I have heard rumors that Lotus notes would be moving to db2 as the datastore..would that mean db2 for windows and Linux have a shot in its arm and become as pervasive as oracle and ms-sql...
5
by: Colin Anderson | last post by:
I discovered, with great excitement, this article http://www.davison.uk.net/vb2notes.asp when researching methods for emailing from Access via Notes. Unfortunatly, when I run this I get a...
1
by: Peter Wright | last post by:
Using MSAccess XP how can I use the DoCmd.SendObject to send email using Lotus Notes - we can pop-up a Notes email form completed with header and body data, but need to despatch the email using...
1
by: s_schutte | last post by:
Here's my situation. I have an unmanaged C++ project that I am using to interface with the Lotus Notes C API. I then have a managed C++ project in the same solution that functions as a "C++...
0
by: Heinz K | last post by:
Hi all, is it possible to access a Lotus Notes database even if Lotus Notes is not installed on current computer? I have an IIS and want to create a Webservice which accesses data from a Lotus...
2
by: charliej2001 | last post by:
Hi all I'm trying to set up an Access database that will be able to import contact information from the lotus notes 6.5 Address book. The idea is that the code runs from access to import all of...
0
by: kohligagan2 | last post by:
Hi, I am working on a scenario . And scenario is I am trying to send an Email using my Lotus notes Client Id ( Lotus notes :- is used for messaging and sending mails work as a middleware) I...
2
by: MarkStorer | last post by:
Hi All I need to email a report (with contains graphs) via Lotus Notes. I've tried the 'SendObjectSnp' method (which works with some Lotus Notes clients (but not many others)); so I used the code...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.