CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 1999
    Location
    Wisconsin
    Posts
    12

    MAPI to send Email to multiple recipients

    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



  2. #2
    Join Date
    Mar 1999
    Posts
    9

    Re: MAPI to send Email to multiple recipients

    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>



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured