I am trying to send email using Exchange 2007 from a console app using the following code and I get this error message in the exception that gets thrown on the Send call.
The SMTP server requires a secure
connection or the client was not
authenticated. The 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.
This ended up being an Exchange 2007 issue and had nothing to do with code.