MailMessage msg = new MailMessage();

msg.From = ConfigurationSettings.AppSettings[“From”].ToString();
msg.Subject = subject;
msg.To = messageTo;

msg.Fields[“
http://schemas.microsoft.com/cdo/configuration/smtpserver“] = Settings.SmtpServer;
msg.Fields[“
http://schemas.microsoft.com/cdo/configuration/smtpserverport“] = Settings.SmtpServerPort.ToString(CultureInfo.InvariantCulture);
msg.Fields[“
http://schemas.microsoft.com/cdo/configuration/sendusing“] = 2;
msg.Fields[“
http://schemas.microsoft.com/cdo/configuration/smtpauthenticate“] = 1;
msg.Fields[“
http://schemas.microsoft.com/cdo/configuration/sendusername“] = Settings.SmtpSendUserName;
msg.Fields[“
http://schemas.microsoft.com/cdo/configuration/sendpassword“] = Settings.SmtpSendPassword;

SmtpMail.Send( msg );

LEAVE A REPLY

Please enter your comment!
Please enter your name here