tags:

views:

21

answers:

1

i am facing this exception while making email delivery system, could any body explain this ...

{System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) --- End of inner exception stack trace --- at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) at Email.mailWrapper.Send(String strTo, String strFrom, String strSubject, String strBody) in C:\Documents and Settings\asd\My Documents\Visual Studio 2005\Projects\PlacementManager\Email\mailWrapper.cs:line 158}

A: 

It's just saying that whatever port you've configured your System.Net.Mail.SmtpClient to is being blocked on the server by a firewall, or else it's not even listening on that port.

John Weldon
but my fire wall is off....i am making it for local machineplease let me know if u caught the problem
NoviceToDotNet
In that case, the port is not even listening. It would help to know what port you configured your SmtpClient to use, and what port you have an SMTP server running on on your localhost.
John Weldon
SMTP server running on port 25, but how to know what port SmtpClient uisng
NoviceToDotNet