Click to See Complete Forum and Search --> : MAPI to send Email to multiple recipients


NeedHelp
July 30th, 1999, 09:39 AM
I am using the MAPI controls to send email to multiple recipients, but I can only get it to one reipient. I have tried commas between recipients and everything and it doesn't work. This is the code I am using:

MAPISession1.UserName = "USERNAME"
MAPISession1.Password = "PASSWORD"

MAPISession1.SignOn

Screen.MousePointer = vbHourglass



With MAPIMessages1
.MsgIndex = -1
.RecipDisplayName = "JON DOE"
.MsgSubject = "TEST"
.MsgNoteText = "THIS IS A TEST"
.SessionID = MAPISession1.SessionID
.Send
End With

Screen.MousePointer = vbNormal

MAPISession1.SignOff

End

Ganesh Bala
August 3rd, 1999, 12:17 PM
You need to increment the RecipIndex property of the MAPI message Control. Put the following code within a loop

li_RecipIndex = li_RecipIndex + 1
MAPIMsg.RecipIndex = li_RecipIndex
MAPIMsg.RecipType = IIf(li_RecipIndex = 0, mapToList, mapCcList)
MAPIMsg.RecipDisplayName = <Email Address>