Send Email using Office365 - C#

Send Email using Office365 - C#

code snippet

using (var client = new SmtpClient{
Credentials = new System.Net.NetworkCredential("username", "password"),
Port = 587, // You can use Port 25 if 587 is blocked 
Host = "";
var mail = new MailMessage();
mail.From = new System.Net.Mail.MailAddress("");
mail.Subject = "Email Subject";
mail.Body = "Email Body";
mail.IsBodyHtml = false; // or true
catch (Exception){

"The measure of who we are is what we do with what we have"

Contact me!

Have questions? Feel free to use the form or send me an email with any questions.

I will be responsive to your requests and your questions.