Thursday, 12 September 2013

Mail being rejected, but not with error I would expect

Mail being rejected, but not with error I would expect

First the simple mail code:
var objMail = new MailMessage(myEmail, myEmail, "Test Message", "Some
message");
var objNc = new NetworkCredential("complete", "rubbish");
var objsmtp = new SmtpClient(myExchangeServer") { UseDefaultCredentials =
false, Credentials = objNc };
I started off with correct credentials and getting this message from
exchange:
Mailbox unavailable. The server response was: 5.7.1 Message rejected as
spam by Content Filtering.
Exchange problem I thought, but I then tried with bad credentials (user:
complete password: rubbish) and I get the same exception.
I would have expected an authentication error, so I suspect I am
specifying the credentials incorrectly?

No comments:

Post a Comment