J
Jason
I've got the code below for sending e-mail using Lotus
Notes. However, it doesn't seem to work if I put more than
one e-mail address in the string I build. Any ideas on
what to do so that I can send e-mails to more than one
person?
Thanks in advance,
Jason
'Create some object variables for the various Notes objects
Dim NotesDB As Object
Dim NotesDoc As Object
Dim NotesRTF As Object
Dim NotesSession As Object
Dim txtDate
Dim strTo, strNCMR
'Get NCM#
strNCMR = Me.NCM_
'Define who to send e-mail to
strTo = strQM
'Use Create object to instantiate a Notes session object
Set NotesSession = CreateObject("Notes.Notessession")
'Instantiate NotesDB object from method off NotesSession
Set NotesDB = NotesSession.getdatabase("", "")
NotesDB.openmail
'Create new Notes document
Set NotesDoc = NotesDB.createdocument
'Send to strTo and set Subject of e-mail
Call NotesDoc.replaceitemvalue("Sendto", strTo)
Call NotesDoc.replaceitemvalue("Subject", "NCMR # " &
strNCMR)
'Creating the Body of the E-Mail
Set NotesRTF = NotesDoc.createrichtextitem("body")
Call NotesRTF.appendtext("NCMR # " & strNCMR & " has
been issued and needs your disposition.")
'Save e-mail
NotesDoc.SAVEMESSAGEONSEND = True
'Send the e-mail
Call NotesDoc.Send(False)
'Destroy the Notes objects
Set NotesSession = Nothing
MsgBox "Email sent.", vbOKOnly + vbInformation, "Email
Sent"
Notes. However, it doesn't seem to work if I put more than
one e-mail address in the string I build. Any ideas on
what to do so that I can send e-mails to more than one
person?
Thanks in advance,
Jason
'Create some object variables for the various Notes objects
Dim NotesDB As Object
Dim NotesDoc As Object
Dim NotesRTF As Object
Dim NotesSession As Object
Dim txtDate
Dim strTo, strNCMR
'Get NCM#
strNCMR = Me.NCM_
'Define who to send e-mail to
strTo = strQM
'Use Create object to instantiate a Notes session object
Set NotesSession = CreateObject("Notes.Notessession")
'Instantiate NotesDB object from method off NotesSession
Set NotesDB = NotesSession.getdatabase("", "")
NotesDB.openmail
'Create new Notes document
Set NotesDoc = NotesDB.createdocument
'Send to strTo and set Subject of e-mail
Call NotesDoc.replaceitemvalue("Sendto", strTo)
Call NotesDoc.replaceitemvalue("Subject", "NCMR # " &
strNCMR)
'Creating the Body of the E-Mail
Set NotesRTF = NotesDoc.createrichtextitem("body")
Call NotesRTF.appendtext("NCMR # " & strNCMR & " has
been issued and needs your disposition.")
'Save e-mail
NotesDoc.SAVEMESSAGEONSEND = True
'Send the e-mail
Call NotesDoc.Send(False)
'Destroy the Notes objects
Set NotesSession = Nothing
MsgBox "Email sent.", vbOKOnly + vbInformation, "Email
Sent"