473,804 Members | 3,732 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 13051
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
15173
by: Sateesh | last post by:
Hi, Is it possible to access Lotus notes using Python? Can anyone provide me some pointers? Thanks Sateesh
10
4246
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
7395
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
5325
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
2133
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
1501
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
11849
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
1798
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
3977
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
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10580
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
10335
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...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9157
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
7621
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
6854
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5525
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...

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.