Send html mail through Lotus Notes via VB.NET application

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi,
Currently Im creating a VB.NET application which send Lotus Notes Mail to people within the company I work for.
This is working fine but now I would like to add a link to an exe application in the mail (in lotus notes it is called hotspot).
I already did some search on the internet but I was not able to find it.
Here is my code until now:<br/>
Set up the objects required for Automation into lotus notes <br/>
Dim Maildb As Object The mail database <br/>
Dim UserName As String The current users notes name <br/>
Dim MailDbName As String THe current users notes mail database name <br/>
Dim MailDoc As Object The mail document itself <br/>
Dim AttachME As Object The attachment richtextfile object <br/>
Dim Session As Object The notes session <br/>
Dim EmbedObj As Object The embedded object (Attachment) <br/>
Start a session to notes <br/>
Session = CreateObject("Notes.NotesSession")<br/>
Get the sessions username and then calculate the mail file name <br/>
You may or may not need this as for MailDBname with some systems you <br/>
can pass an empty string <br/>
UserName = Session.UserName<br/>
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"<br/>
Open the mail database in notes <br/>
Maildb = Session.GETDATABASE("", MailDbName)<br/>
If Maildb.IsOpen = True Then<br/>
Already open for mail <br/>
Else<br/>
Maildb.OPENMAIL()<br/>
End If<br/>
Set up the new mail document <br/>
MailDoc = Maildb.CREATEDOCUMENT<br/>
MailDoc.Form = "Memo"<br/>
MailDoc.sendto = recipient<br/>
MailDoc.Subject = Subject<br/>
MailDoc.Body = bodytext & vbCrLf & vbCrLf
MailDoc.SAVEMESSAGEONSEND = saveit<br/>
Set up the embedded object and attachment and attach it <br/>
If attachment <> "" Then<br/>
AttachME = MailDoc.CREATERICHTEXTITEM("Attachment")<br/>
EmbedObj = AttachME.EMBEDOBJECT(1454, "", attachment, "Attachment")<br/>
End If<br/>
Send the document <br/>
MailDoc.PostedDate = Now() Gets the mail to appear in the sent items folder <br/>
MailDoc.SEND(0, recipient)<br/>
Clean Up <br/>
Maildb = Nothing<br/>
MailDoc = Nothing<br/>
AttachME = Nothing<br/>
Session = Nothing<br/>
EmbedObj = Nothing
Does anyone has an idea?<br/>
Thanks

View the full article
 
Back
Top