CodeItBetter Programming Another VB Programming Blog

How to send mail from VB app using MAPI control.

Posted on August 11, 2011
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
'Internet - How to send mail from VB app using MAPI control.
Private Sub cmdSendMail_Click()
    'Add the MAPI component to your VB project. Also, add a MAPISession
    'and MAPIMessage control to your form.
    MAPISession1.SignOn
    With MAPIMessages1
        .MsgIndex = -1
        .RecipDisplayName = Recipientemail
        .msgSubject = msgSubject    ' subject of e-mail
        .MsgNoteText = Body    'message body
        .SessionID = MAPISession1.SessionID
        .Send
    End With
    MAPISession1.SignOff
End Sub
Filed under: Internet Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.