Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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()

Posted

@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");

  • Administrators
Posted
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.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...