SmtpClient smtp = new SmtpClient(Smtp, Convert.ToInt32(port)); smtp.Credentials = new NetworkCredential(login, pass); smtp.EnableSsl = true; MailMessage message = new MailMessage(); message.From = new MailAddress(from); message.To.Add(new MailAddress(to)); message.IsBodyHtml = true; message.Subject = subject; message.Body = string.Format(msg); message.BodyEncoding = Encoding.UTF8; Console.WriteLine(msg); ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; }; smtp.Send(message)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)