Link to home
Start Free TrialLog in
Avatar of leekf
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.Notessession")
    Set OLEDB = OLESess.GetDatabase(LotusNotesServer, 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("BODY")
        .Form = "Memo"
        .Subject = MySubject
        .SendTo = MySendTo
        .CopyTo = MyCopyTo       <<<<<<<-----------------
        .Body = MyBody
        .postdate = Date
        .SaveMessageOnSend = True
        .PostedDate = Now
        Call NItem.EmbedObject(EMBED_ATTACHMENT, "", MyAttach)
        .Send False
    End With
   
 
ASKER CERTIFIED SOLUTION
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of HemanthaKumar
HemanthaKumar

> .CopyTo = MyCopyTo       <<<<<<<-----------------
Replace the above line with this

.CopyTo = Split(MyCopyTo, ",")

~Hemanth