
Problem in Sending mails using MAPI Controls.
We have developed a bulk mailing program which gets the
Name and e-mail id of the persons and send a
notification message. The forms has been developed in VB
and we had used the MAPIMessages control and the
MAPISession control to send the messages. I am attaching
a portion of the code which sends the message. The problem
is that there are two mails being sent and also though the
this he is also getting the mail properly addressed to
him. Has this got anything to do with the MAPI Sessions?
How do you control the MAPI Sessions for such cases. Will
be thankful if you can point out where it could have gone
wrong and please share any code you have. We are using a
POST CAST server at our place to send the mails.
If MAPISession.SessionID = 0 Then
MAPISession.SignOn
b = True
End If
With MAPIMessages
.SessionID = MAPISession.SessionID
.MsgIndex = -1
.Compose
.RecipAddress = SendTo
.RecipType = 1
.ResolveName
.MsgSubject = Subject
.MsgNoteText = EmailText
.Send False
End With
MAPISession.SignOff
Thanks and Regards
Sanju