Answers for "Send Hotmail/Outlook Email C# (Win/ASP.NET)"

C#
0

Send Hotmail/Outlook Email C# (Win/ASP.NET)

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]", "password");
SmtpServer.EnableSsl = true;
SmtpServer.Send(mail);
Posted by: Guest on September-22-2021

C# Answers by Framework

Browse Popular Code Answers by Language