473,695 Members | 2,841 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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,strD est, strCopy, strFilename;

lotus.NOTESSESS ION session;

lotus.NOTESDATA BASE db;

lotus.NOTESDOCU MENT doc;

lotus.NOTESFORM form;

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

strDest = so*****@yahoo.c om;

strCopy = "Copyto";

//Session = createobject("N otes.NotesSessi on"); // Creates a Notes Session

//Type NotesSession = Type.GetTypeFro mProgID("lotus. NOTESSESSION");

//session = (lotus.NOTESSES SION)Activator. CreateInstance( NotesSession);

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

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

db = (lotus.NOTESDAT ABASE)session.G ETDATABASE(Serv er, Mailfile,true); // Try
to open the mail Database


if (db == null)

{

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

return;

}

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

//doc.AUTHORS = session.USERNAM E; //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.t xt";

lotus.NOTESRICH TEXTITEM item =
(lotus.NOTESRIC HTEXTITEM)doc.C REATERICHTEXTIT EM("Body");

item.EMBEDOBJEC T(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 13044
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******** *******@TK2MSFT NGP02.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,strD est, strCopy, strFilename;

lotus.NOTESSESS ION session;

lotus.NOTESDATA BASE db;

lotus.NOTESDOCU MENT doc;

lotus.NOTESFORM form;

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

strDest = so*****@yahoo.c om;

strCopy = "Copyto";

//Session = createobject("N otes.NotesSessi on"); // Creates a Notes Session

//Type NotesSession = Type.GetTypeFro mProgID("lotus. NOTESSESSION");

//session = (lotus.NOTESSES SION)Activator. CreateInstance( NotesSession);

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

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

db = (lotus.NOTESDAT ABASE)session.G ETDATABASE(Serv er, Mailfile,true); //
Try to open the mail Database


if (db == null)

{

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

return;

}

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

//doc.AUTHORS = session.USERNAM E; //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.t xt";

lotus.NOTESRICH TEXTITEM item =
(lotus.NOTESRIC HTEXTITEM)doc.C REATERICHTEXTIT EM("Body");

item.EMBEDOBJEC T(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
15149
by: Sateesh | last post by:
Hi, Is it possible to access Lotus notes using Python? Can anyone provide me some pointers? Thanks Sateesh
10
4236
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 server.. would appreciate your thoughts on this.. regards Hrishy
5
7380
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 Run-time error. When I run it on an XP machine it crashes, but on an NT box it just generates an unknown error, handled by the error handler. I have debugged and stepped through the code and have narrowed the issue to the point at which the...
1
5318
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 office automation. TIA Peter Wright
1
2129
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++ Bridge". It defines a function in a header that the native C++ library can call, and then it forwards the calls along to a third project, which is a C# DLL, and displays a System.Windows.Form. So, I have: Lotus -> Native C++ -> Managed C++ -> C#
0
1494
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 Notes Server. I found solutions if Lotus Notes is installed locally, but on my IIS Notes is not and will not be installed. Is it nevertheless possible to read data from the database? Thanks!
2
11832
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 the contacts, using COM. I've written the following vba code so far to import the contacts
0
1785
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 have an ASP .NET website running on a IIS Server with Lotus note is running at the machine where server is running. One client sends the request to the server and correspondingly mail goes to the respective person as mentioned. I am using a...
2
3966
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 below: - Public Sub SEND_EMAILS() Dim session As Object Dim db As Object Dim doc As Object Dim rtitem As Object
0
9112
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8971
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7651
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4336
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4571
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2994
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2258
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.