Author |
|
MR Naidu Newbie
Joined: 11 September 2011
Online Status: Offline Posts: 5
|
Posted: 11 September 2011 at 12:09pm | IP Logged
|
|
|
Hello there,
I used simple SMTP mail sending code and it encounter the following error.
MailBee.MailBeeSocketTimeoutException: Socket connection has timed out. InnerException message follows: 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 65.55.162.200:25 ---> 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 65.55.162.200:25 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.Connect(EndPoint remoteEP) at a.l.a(IPEndPoint A_0) --- End of inner exception stack trace --- at a.l.a(Exception A_0) at a.l.a(IPEndPoint A_0) at a.m.a(IPEndPoint A_0) at a.at.a(IPHostEntry A_0, Int32 A_1) at a.n.a(String A_0, Int32 A_1, Boolean A_2, Socket A_3, EndPoint A_4) at a.n.x() at a.c.f.x() at a.c.c.x() at a.c.f.a(MailMessage A_0, String A_1, EmailAddressCollection A_2, DeliveryNotificationOptions A_3, Smtp8bitDataConversion A_4, Boolean A_5, SendFailureThreshold A_6, Boolean A_7, DataTable A_8, Int32 A_9, String A_10) at a.c.c.a(MailMessage A_0, String A_1, EmailAddressCollection A_2, DeliveryNotificationOptions A_3, Smtp8bitDataConversion A_4, Boolean A_5, SendFailureThreshold A_6, Boolean A_7, DataTable A_8, Int32 A_9, String A_10) at a.c.d.a(MailMessage A_0, String A_1, EmailAddressCollection A_2, DeliveryNotificationOptions A_3, Smtp8bitDataConversion A_4, Boolean A_5, SendFailureThreshold A_6, Int32 A_7, ay A_8, Boolean A_9, DataTable A_10, Int32 A_11, String A_12) at a.c.h.a(String A_0, EmailAddressCollection A_1) at a.c.h.a(Boolean A_0, String A_1, EmailAddressCollection A_2) at a.c.h.a(Boolean A_0) at MailBee.SmtpMail.Smtp.Send() at pop3_test1.Button2_Click(Object sender, EventArgs e)
----------------------------------------------
Firstly I checked for the previous forums of this kind and I tried adding the below lines
Global.SafeMode = true;
mailer.SmtpServers[0].SmtpOptions = ExtendedSmtpOptions.NoChunking;
Still I am getting the same error. Please help me how to fix this error.
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 12 September 2011 at 8:17am | IP Logged
|
|
|
Your issue occurs during the connection stage, not during the sending stage (for which things like ExtendedSmtpOptions.NoChunking may help). Looks like 65.55.162.200 at port 25 is simply not available from your location. Such as blocked by firewall on your computer or your ISP's server.
Regards,
Alex
|
Back to Top |
|
|
MR Naidu Newbie
Joined: 11 September 2011
Online Status: Offline Posts: 5
|
Posted: 12 September 2011 at 10:46am | IP Logged
|
|
|
When I am using the connection test as below
try
{
mailer.SmtpServers.Add("mail.domain.com", "test@domain.com", "test").Port = 25;
Response.Write("connected");
}
catch (Exception Ex)
{
Response.Write(Ex);
}
I am getting output as Connected. Seems that I am able to connect to the mail server but when I add the following code to send mail I am getting error.
Smtp mailer = new Smtp();
mailer.DnsServers.Autodetect();
mailer.From.Email = "test@domain.com";
mailer.To.Add("test@gmail.com");
mailer.Subject = "Test message";
mailer.BodyPlainText = "Just a test";
mailer.Send();
By doing the above I am getting the error that is mentioned in the question.
|
Back to Top |
|
|
MR Naidu Newbie
Joined: 11 September 2011
Online Status: Offline Posts: 5
|
Posted: 12 September 2011 at 10:54am | IP Logged
|
|
|
I am running mailbee on windows 2003 and my firewall is turned off. I tried turning on firewall and added an exception to port 25 but still I am getting the same error.
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 12 September 2011 at 1:01pm | IP Logged
|
|
|
mailer.DnsServers.Autodetect() uses absolutely different approach to sending (direct send, via DNS MX lookup). For direct send, to work reliably, you must have access to all public SMTP servers on the planet.
Use SMTP relay server to send email (and populate Smtp.SmtpServers collection instead of Smtp.DnsServers), do not use direct send unless you exactly know what you're doing.
Regards,
Alex
|
Back to Top |
|
|