Wednesday, March 28, 2012

Visual Basic Tutorial ( Send Fake Email with attachment ) [ 2 ]





Download Visual Basic:
http://www.microsoft.com/visualstudio/en-us 




MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "you@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "this is my test email body.";
MailAttachment attachment = new MailAttachment( Server.MapPath( "test.txt" ) ); //create the attachment
mail.Attachments.Add( attachment ); //add the attachment
SmtpMail.SmtpServer = "localhost";  //your real server goes here
SmtpMail.Send( mail );

No comments:

Post a Comment