leekf
asked on
code to send CC to multiple receivers
I am writing VB program to send email by Lotus Notes and the code is attached below. I would like to send CC to multiple receivers. How to do that?
PS: I cannot do that with comma (,) ie:
MyCopyTo = "first@mail.com, second@mail.com, third@mail.com"
Thanks
The Code:
On Error GoTo LotusError
Dim OLESess As Object
Dim OLEDB As Object
Set OLESess = CreateObject("Notes.Notess ession")
Set OLEDB = OLESess.GetDatabase(LotusN otesServer , LotusNotesPath)
On Error GoTo NotesError
Const EMBED_ATTACHMENT = 1454
' Creates a new document/message.
Dim Doc As Object
Dim NItem As Object
Set Doc = OLEDB.CreateDocument
With Doc
' creates body of message and populates headers
Set NItem = Doc.CreateRichTextItem("BO DY")
.Form = "Memo"
.Subject = MySubject
.SendTo = MySendTo
.CopyTo = MyCopyTo <<<<<<<-----------------
.Body = MyBody
.postdate = Date
.SaveMessageOnSend = True
.PostedDate = Now
Call NItem.EmbedObject(EMBED_AT TACHMENT, "", MyAttach)
.Send False
End With
PS: I cannot do that with comma (,) ie:
MyCopyTo = "first@mail.com, second@mail.com, third@mail.com"
Thanks
The Code:
On Error GoTo LotusError
Dim OLESess As Object
Dim OLEDB As Object
Set OLESess = CreateObject("Notes.Notess
Set OLEDB = OLESess.GetDatabase(LotusN
On Error GoTo NotesError
Const EMBED_ATTACHMENT = 1454
' Creates a new document/message.
Dim Doc As Object
Dim NItem As Object
Set Doc = OLEDB.CreateDocument
With Doc
' creates body of message and populates headers
Set NItem = Doc.CreateRichTextItem("BO
.Form = "Memo"
.Subject = MySubject
.SendTo = MySendTo
.CopyTo = MyCopyTo <<<<<<<-----------------
.Body = MyBody
.postdate = Date
.SaveMessageOnSend = True
.PostedDate = Now
Call NItem.EmbedObject(EMBED_AT
.Send False
End With
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Replace the above line with this
.CopyTo = Split(MyCopyTo, ",")
~Hemanth