Code to send mail and settting it's priority to High.

Posted by VIRENDRADUGAR under ASP.NET category on | Views : 1566
Below is a static function which accepts 4 parameters and compiles the mail and send it. The thing to notice over here is, it sets the priority of the mail to High. We can also set it to Medium and low.

public static void SendMail(String strToEMail, String strFromEMail, String strMessageBody, String strSubject)
MailMessage mail = new MailMessage();
mail.To = strToEMail;
mail.From = strFromEMail;
mail.Subject = strSubject;
mail.BodyFormat = MailFormat.Html;
mail.Body = strMessageBody;
SmtpMail.SmtpServer = ConfigurationManager.AppSettings["SMTPServer"];


Comments or Responses

Login to post response