PDA

View Full Version : System.Net.Mail Error 550 Authentication required for relay


we2j53d
10-28-2009, 05:57 AM
I set up an email system with System.Net.Mail in my c# codebehind, and I get:

host said: 550 Authentication is required for relay

I used a credentials object and supplied the correct names/passwords, and tried through port 25 and port 587, but still get the same error.

My smtp server is smtp.mydomain.com.

What's the problem?

Ramses
10-28-2009, 07:28 AM
Could you provide us with the code that you're using to send out the email?

Also, you could always try sending through "localhost", which doesn't require authentication, so it's definitely a lot easier that way.

we2j53d
10-28-2009, 09:54 AM
Here's the code:

MailMessage msg = new MailMessage();

msg.From = new MailAddress("noreply@coactumsolutions.com");
msg.Subject = <subject>;
msg.BodyEncoding = Encoding.ASCII;
msg.IsBodyHtml = true;
msg.Body = message;
msg.To.Add(new MailAddress("someAddress@someDomain.com"));

System.Net.NetworkCredential info = new System.Net.NetworkCredential(
"noreply@coactumsolutions.com", <password>);
SmtpClient sc = new SmtpClient("smtp.coactumsolutions.com", 587);
sc.UseDefaultCredentials = false;
sc.Credentials = info;
sc.Send(msg);

bruce
10-28-2009, 10:57 AM
Are you sure the username / password is correct?

Is this app hosted on our server? If so, switch to localhost as the SMTP server.