To send a message via TLS / SSL, you need to set the Ssl of the SmtpClient class to true.
string to = "jane@contoso.com"; string from = "ben@contoso.com"; MailMessage message = new MailMessage(from, to); message.Subject = "Using the new SMTP client."; message.Body = @"Using this new feature, you can send an e-mail message from an application very easily."; SmtpClient client = new SmtpClient(server);
Jason Dang Nov 01 '17 at 9:15 on 2017-11-01 09:15
source share