473,320 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 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 13003
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.