Skip to content

Instantly share code, notes, and snippets.

@h2ospace
Last active June 21, 2018 23:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h2ospace/7138758a776af751d1545c2647c24db8 to your computer and use it in GitHub Desktop.
Save h2ospace/7138758a776af751d1545c2647c24db8 to your computer and use it in GitHub Desktop.
Send Email from Gmail by C#(.NET Core)
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient('smtp.gmail.com', 587);
smtp.EnableSsl = true;
smtp.Credentials = new System.Net.NetworkCredential("***id***", "***password***");
System.Net.Mail.MailMessage oMsg = new System.Net.Mail.MailMessage("from", "to", "subject", "body");
smtp.Send(oMsg);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment