Lotus Notes e-mail

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"
 
G

Guest

That did it - thanks!

Jason
-----Original Message-----
Create a string array, and put each e-mail address as a separate entry in
the array:

Dim strTo(3) As String

strTo(1) = person1@address1
strTo(2) = person2@address2
strTo(3) = person3@address3

then continue using

Call NotesDoc.replaceitemvalue("Sendto", strTo)

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)






.
 

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