Friday, May 6, 2005

Send mail in ASP.NET

MailMessage oMsg = new MailMessage();
oMsg.From = "me@MyServer.Net";
oMsg.To = "you@YourServer.Net";
oMsg.Cc = "him@HisServer.Net";
oMsg.Subject = "Test";oMsg.Body = "This is only a test";
oMsg.Attachments.Add(new MailAttachment("c:\temp\Test.txt"));
SmtpMail.Send(oMsg);

No comments:

 
Jeffrey Ting Jeffrey Ting on Facebook Jeffrey Ting on Spock Jeffrey Ting on Plaxo Jeffrey Ting on Spoke Jeffrey Ting on LinkedIn