SmtpClient smtpClient = new SmtpClient();
NetworkCredential smtpCredentials = new NetworkCredential("email from","password");

MailMessage message = new MailMessage();
MailAddress fromAddress = new MailAddress("email from");
MailAddress toAddress = new MailAddress("email to");

smtpClient.Host = "smpt host address";
smtpClient.Port = your_port;
smtpClient.EnableSsl = true;
smtpClient.UseDefaultCredentials = false;
smtpClient.Credentials = smtpCredentials;
smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
smtpClient.Timeout = 20000;

message.From = fromAddress;
message.IsBodyHtml = false;
message.Subject = "example";
message.Body = "example";

downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter