NetworkCredential basicCredentials = new NetworkCredential(this.MailUserName, this.MailPassword);
MailMessage mail = new MailMessage();
mail.IsBodyHtml = this.HTMLSupported;
mail.From = new MailAddress("results@r1qe.com", "Critical " + (char)0xD8 + " Results", System.Text.Encoding.UTF8); // put the from address here
mail.To.Add(new MailAddress("results@r1qe.com")); // put to address here
mail.ReplyTo = (new MailAddress("results@r1qe.com")); // put reply to address here
mail.Subject = "email test"; // put subject here
mail.SubjectEncoding = System.Text.Encoding.UTF8;
mail.Body = "test of email sender"; // put body of email here
mail.BodyEncoding = System.Text.Encoding.UTF8;
//Set Up Outgoing smtp requires authentication support
SmtpClient wClient = new SmtpClient(this.SMTPMailServer, this.SMTPMailPort);
wClient.Timeout = this.MailServerTimeouts;
wClient.EnableSsl = this.SSLRequired;
if (this.OutGoingSerReqAuth == true)
{
wClient.UseDefaultCredentials = false;
wClient.Credentials = basicCredentials;
}
else
{
wClient.UseDefaultCredentials = true;
}
wClient.Send(mail);
Do more with
Premium Content
You need an Expert Office subscription to comment.Start Free Trial