Sending an Email via Lotus Notes

J

Jologs

Hi:

I got the following codes from
http://www.granite.ab.ca/access/email/lotusnotessample.htm. How will I
assign variable for the 'Sendto' values. Because, I have a txtbox in
the form that holds the e-mail address. How can I assign the value of
the txtbox to the "Sendto'. Thanks.


Dim notesdb As Object
Dim notesdoc As Object
Dim notesrtf As Object
Dim notessession As Object
Set notessession = CreateObject("Notes.Notessession")
Set notesdb = notessession.getdatabase("", "")
Call notesdb.openmail
Rem make new mail message
Set notesdoc = notesdb.createdocument
Call notesdoc.replaceitemvalue("Sendto", strSupportEMail)
Call notesdoc.replaceitemvalue("Subject", "Problem Report")
Set notesrtf = notesdoc.createrichtextitem("body")
Call notesrtf.appendtext("Problem Report")
Call notesrtf.addnewline(2)
Rem attach Error Report doc
's = ActiveDocument.Path + "\" + ActiveDocument.Name
Call notesrtf.embedObject(1454, "", strCurrentPath, "Mail.rtf")
Rem send message
Call notesdoc.Send(False)
Set notessession = Nothing

GB located the following snippet for passing the password.

Dim MailPassword As String
Dim lnSession As NotesSession
Set lnSession = CreateObject("Lotus.NotesSession")
Call lnSession.Initialize(MailPassword)
 
J

Jologs

I've tried that already but it did not worked. Only to find out that
the 'strSupportEMail' should not be altered. All you have to do is to
Declare it as a string and assigned the value of the txtbox to it.
Thanks.
[Forms]![YourFormName]![YourTextBoxName]

Jologs said:
Hi:

I got the following codes from
http://www.granite.ab.ca/access/email/lotusnotessample.htm. How will I
assign variable for the 'Sendto' values. Because, I have a txtbox in
the form that holds the e-mail address. How can I assign the value of
the txtbox to the "Sendto'. Thanks.


Dim notesdb As Object
Dim notesdoc As Object
Dim notesrtf As Object
Dim notessession As Object
Set notessession = CreateObject("Notes.Notessession")
Set notesdb = notessession.getdatabase("", "")
Call notesdb.openmail
Rem make new mail message
Set notesdoc = notesdb.createdocument
Call notesdoc.replaceitemvalue("Sendto", strSupportEMail)
Call notesdoc.replaceitemvalue("Subject", "Problem Report")
Set notesrtf = notesdoc.createrichtextitem("body")
Call notesrtf.appendtext("Problem Report")
Call notesrtf.addnewline(2)
Rem attach Error Report doc
's = ActiveDocument.Path + "\" + ActiveDocument.Name
Call notesrtf.embedObject(1454, "", strCurrentPath, "Mail.rtf")
Rem send message
Call notesdoc.Send(False)
Set notessession = Nothing

GB located the following snippet for passing the password.

Dim MailPassword As String
Dim lnSession As NotesSession
Set lnSession = CreateObject("Lotus.NotesSession")
Call lnSession.Initialize(MailPassword)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top