Exchange 2007 does not allow sending mail from a console application
I am trying to send an email using Exchange 2007 from a console application using the following code and I am getting this error message in an exception that is being thrown to challenge the send.
The SMTP server requires a secure connection, or the client has not been authenticated. Server response was: 5.7.1 Client was not authenticated
MailMessage message = new MailMessage();
message.From = new MailAddress("from@example.com");
message.To.Add("to@domain.com");
message.Subject = "test";
SmtpClient smtp = new SmtpClient(ConfigurationUtil.SMTPServer);
smtp.Credentials = new System.Net.NetworkCredential("from@example.com", "password");
smtp.Send(message);
This worked on Exchange 2003.
0
a source to share