using System;
using System.Web.Mail;
Code:
static void Main(string[] args)
{
MailMessage mailMsg = new MailMessage();
mailMsg.From = "saurabhsingh_jnu06@yahoo.co.in";
mailMsg.To = "saurabhjnumca@gmail.com";
mailMsg.Cc = string.Empty;
mailMsg.Bcc = string.Empty;
mailMsg.Subject = "Here goes a subject";
mailMsg.Body = "Here goes email body";
mailMsg.Priority = (MailPriority)1;
mailMsg.Attachments.Add(new MailAttachment("d:\\myText.txt"));
SmtpMail.SmtpServer = "smarthost";
SmtpMail.Send(mailMsg);
}
0 comments:
Post a Comment