VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



A+ code: send silent e-mails using mapi easily

by erLog (3 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (23 Votes)

This code will teach the beginner how to send anonymous and silent e-mails from within their VB apps. Great for silently mailing back a keylogging file! This is meant for the absolute beginner so don't bother pointng out that it is simple. If you use it there is no need to give me credit but please vote or say you like it!

Assumes
you need to have a mapi - enabled e-mail client (such as outlook express) and place the controls on a form (right click toolbar then microsoft mapi controls) with a command button.

Rate A+ code: send silent e-mails using mapi easily

'***********************
'By littlegreenrussian *
'***********************
Private Sub Command1_Click() 'user clicks send
On Error GoTo mailerr: 'go to the error handling bit if there is an error
MAPISession1.SignOn 'sign on
If MAPISession1.SessionID <> 0 Then 'signed on
With MAPIMessages1
.SessionID = MAPISession1.SessionID
.Compose 'start a new message
.AttachmentName = "..." 'attachment name
.AttachmentPathName = Text1 ' attachment path (get this from the text box or a default dirrectory)
.RecipAddress = Text2 'set the receiver's email to the one they specified (again, text box or a default address)
.MsgSubject = "..." 'set the subject
.MsgNoteText = "............" 'message text
.Send False 'don't display a dialog saying it was sent

End With
Exit Sub
End If
mailerr: 'error handling
MsgBox "Error " & Err.Description
End Sub

Download this snippet    Add to My Saved Code

A+ code: send silent e-mails using mapi easily Comments

No comments have been posted about A+ code: send silent e-mails using mapi easily. Why not be the first to post a comment about A+ code: send silent e-mails using mapi easily.

Post your comment

Subject:
Message:
0/1000 characters