I am trying to send email through my asp.net Application and it is throwing the error "The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM [SG2PR0601CA0003.apcprd06.prod.outlook.com]"
MailMessage message = new MailMessage();
SmtpClient SmtpServer = new SmtpClient("smtp.live.com");
message.From = new MailAddress("[email protected]");
message.To.Add("[email protected]");
message.Subject = "Test Email";
message.Body = "Email Body";
SmtpServer.Port = 587;
SmtpServer.Credentials = new
System.Net.NetworkCredential("[email protected]", "xxxxxxxx");
//SmtpServer.EnableSsl = true;
SmtpServer.Timeout = 60000; // 60 seconds
SmtpServer.Send(message);