Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,

I have a send mail program, and the mail sever is a third partu, not my local host.

Now I can send mail when the program runs locally, but when I upload to the two remote host , one is work, and other receives the error as below:

Exception Details: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it XXX.XX.XX.XXX:25


I tried other mail server still ran into the same problem. So, is the host problem? ...or mail server?

Could any one tell me what is happening?
Posted
Updated 12-Oct-10 8:35am
v2
Comments
cmanderson 12-Oct-10 12:07pm    
Can you clarify? Are you uploading your send mail program to two different servers where the program works from one server but not the other?
Brij 12-Oct-10 13:00pm    
You get this error when you try to connect to a computer on a specific port and the host computer is not listening for any request on that port.Try if that port is listening
GaSui 12-Oct-10 21:37pm    
Thanks.
yes, I have two server host, with the same send mail programe, one server work, the other one not work. so i think not because the mail server refused, and one things remind the two server in different language and place, may block the ip?

1 solution

The fact that the remote server actively refused the connection suggests that you are making a connection to the server.

On the remote machine, are you sure you have the IP address of the mail server correct?

Try Telnet to the SMTP server from the remote server, and then go through the normal SMTP command set to see what it comes back with. If this works then, I would go with an authentication issue next, on the remote server you uploaded to, it is maybe trying to authenticate with the smtp server using the wrong credentials.
 
Share this answer
 
Comments
GaSui 12-Oct-10 21:55pm    
in my program setup, the host is smtp.XXX.com.cn, in the error info, the ip is correct, and one things, when I ping the smtp.XXX.com.cn, it not work (request time out). but the amzing problem is that i can use by the outlook and some other .net host. so i dn't know how to check.
DaveAuld 13-Oct-10 17:04pm    
GaSui, the server connection/gateway/router etc. may not be configured to respond to a ping request, this can be normal. if you do a Tracert, you will see the point at which the connections stop responding.
If one application is working, and another one is not, on the same machine, then your software may be needed to be added to the firewall allowed list.
GaSui 18-Oct-10 4:30am    
ok, so i think it is the server problem.
Thanks a lot, DaveAuld
DaveAuld 18-Oct-10 5:35am    
The firewall issue may be the client side.....If one application e.g. outlook connects to the mail server fine, but your client app on the same machine using the same settings does not, the firewall may be blocking your client app.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900