dotnetnewbie1 Posted June 3, 2008 Posted June 3, 2008 Hi, I had some code that sent a simple email using SmtpClient in C# + VS 2005. We've now upgraded that server to the 64 bit version, and a simple test using SmtpClient fails. I've confirmed that: 1. the same .exe works successfully from a 32 bit machine 2. the 64 bit server can ping the mail server dns alias successfully. Any ideas why this wouldn't be working on the 64 bit machine? Below is the error when run from a command prompt. Unhandled Exception: System.Net.Mail.SmtpException: Failure sending mail. ---> S ystem.Net.WebException: Unable to connect to the remote server ---> System.Net.S ockets.SocketException: No connection could be made because the target machine a ctively refused it at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddre ss socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Sock et 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 ow ner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket 6, 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, GeneralAsyncD elegate asyncCallback, Int32 creationTimeout) at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) at Mail.Application.simpleText() Quote
Administrators PlausiblyDamp Posted June 3, 2008 Administrators Posted June 3, 2008 Is the 64bit version configured to point at the correct mail server? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
dotnetnewbie1 Posted June 4, 2008 Author Posted June 4, 2008 @PlausiblyDamp What exactly do you mean by "configured"? If you mean SmtpClient is being given the appropriate mail host, then yes e.g. SmtpClient client = new SmtpClient("my mail server that works when run on win32 os"); Quote
Administrators PlausiblyDamp Posted June 4, 2008 Administrators Posted June 4, 2008 If it is the same .exe then it is probably down to the OS configuration - can you telnet into the mail server from the 64bit OS? If not I would check the firewall configuration to see if it is allowing access out on the correct port. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.