Code bellow shows how to send emails from asp.net c# from web servers .
public void SendMail()
{
MailMessage mm = new MailMessage("from id ", "toid");
//(2) Assign the MailMessage's properties
mm.Subject = "sub";
mm.Body = "message";
mm.IsBodyHtml =true;
//(3) Create the SmtpClient object
//'Dim smtp As New SmtpClient
SmtpClient smtp = new SmtpClient("webmail.domain");
//'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm);
}
No comments:
Post a Comment