Sending emails

Hi guys,

I thought of publishing this article abt sending emails in ASP.net. It might help somebody.

If you are using ASP.net 2.0 you can this method

System.Net.Mail.MailMessage mailMessage = new System.Net.Mail.MailMessage(“fromaddress”, “toAddress”);
mailMessage.Body = “body”;
mailMessage.Subject = “subject”;

System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient(“mailhost”);
smtp.Send(mailMessage);
You need to configure SMTP IN your IIS.

Advertisements