Created
June 6, 2016 20:06
-
-
Save rmgimenez/920f034f539dab9681efb7fba36297d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Colocar no using | |
// using System.Net.Mail; | |
SmtpClient SmtpServer = new SmtpClient("smtp.live.com"); | |
var mail = new MailMessage(); | |
mail.From = new MailAddress("[email protected]"); | |
mail.To.Add("[email protected]"); | |
mail.Subject = "Test Mail - 1"; | |
mail.IsBodyHtml = true; | |
string htmlBody; | |
htmlBody = "Write some HTML code here"; | |
mail.Body = htmlBody; | |
SmtpServer.Port = 587; | |
SmtpServer.UseDefaultCredentials = false; | |
SmtpServer.Credentials = new System.Net.NetworkCredential("[email protected]", "senha"); | |
SmtpServer.EnableSsl = true; | |
SmtpServer.Send(mail); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment