views:

196

answers:

2

I'm writing a ASP.NET application used within our company. Now I want to send emails to some users via a email account on our exchange server.

I tried to use System.Net.Mail.SmtpClient, where a proprietary account and password are given to specify the credentials. But the code failed with following exception: "No connection could be made because the target machine actively refused it"

Is that due to Exchange Server policies to prevent spam? How can I get it to work?

A: 

This error message is normally received when there is nothing listening at the specified IP-address and port for a TCP connection. AFAIK the SMTP protocol uses TCP. Please make sure your server address is correct and that the server does not use a non-standard port.

Peter
A: 

I've previously experienced this when McAfee was blocking activity on port 25. Took me ages to work it out as I just didn't think of it (I did verify my Windows firewall was allowing the connection).

Just a thought - might not be applicable in your situation.

Michael Shimmins