Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Monday, April 4, 2016 3:56 PM
System.Net.Mail.SmtpException: Failure sending mail. > System.Net.WebException: Unable to connect to the remote server > System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 209.85.201.109:25 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, 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) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, 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(ServicePoint servicePoint) at System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint) 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 Eduassist.Institute_admin.Main.send_email() |
All replies (3)
Monday, April 4, 2016 4:32 PM ✅Answered
Anand,
I can see you just joined the community. The reason you don't have any answers is because you did not post an actual question, or a description of the context on which this exception occurred. I suggest you edit your post with these details to obtain community support.
Looking at the exception it is clear that your application is failing to connect to 209.85.201.109:25. Did you check Firewall on both ends? Perhaps a list of allowed IP on the target server?
If you like this or another reply, vote it up!
If you think this or another reply answers the original question, mark it or propose it as an answer.
Mauricio Feijo
www.mauriciofeijo.com
Tuesday, April 5, 2016 8:02 AM ✅Answered
Hi anandrajktr,
I've searched more, someone has the same issue as yours.
The proxy setting that you want to add to the config file is as below
<system.net>
<defaultProxy>
<proxy usesystemdefault = "false"
proxyaddress="http://relay-hosting.secureserver.net:25"
bypassonlocal="false"/>
</defaultProxy>
<mailSettings>
<smtp>
<network host="relay-hosting.secureserver.net" userName="XXXXX" password="XXXX"/>
</smtp>
</mailSettings>
</system.net>
Best regards,
Kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.
Tuesday, April 5, 2016 12:01 PM ✅Answered
The exception is pretty clear: The other end did not respond in time. Timeout happened. So this is a networking problem, not a programming one. But I just happen to know a bit about this to.
209.85.201.109:25 means IP adress 209.85.201.109, Port Number 25.
Reversne DNS found no domain to that IP. So either there is no DNS entry, or there is a Dynamic IP adress and a Service like DynDNS.
I can only guess two things from that miniscule amount of information you gave us.
1. Port 25 is the issue. Port 25 is historically used for not-secured outgoing mail connections. As that ended up being overused for Spam, ISP worldwide made it common practice to block any outgoing connections targetting port 25. Annoying, but there for any private internet connections.
2. nd part is the lack of DNS/DynDNS entry. That implies you try to host your own mailserver. But the NAT in your router is no longer the only NAT you have to content with. Carrier Grade NAT has become a thing. And the only way to get through it, is via TCP hole punching or paying extra to have a fixed IP adress.
If it is not for something like hosting a server, I would just say to use a existing VPN solution to connect the client and host through the routers and CG Nat on both ends.
If you want to talk to a existign mailserver without DNS entry, port 25 was propably the issue.
If you want to host your own mailserver, you have to pay for (somewhat) fixed IP adress with no Carrier Grade NAT. And you need to change the target port too.
It is no longer easy to just host your own Server with Port Fowarding and DynDNS/direct IP use.