3
votes

I am trying to set up mail functionality using goDaddy smtp servers,Go daddy support is also not very useful here.

I have tried these servers:

relay-hosting.secureserver.net -Errors-Unable to connect\

smtpout.secureserver.net -Errors-Unable to read data from the transport connection: net_io_connectionclosed

This is what goDaddy says:

enter image description here

This is my code snippet:

MailMessage mail = new MailMessage("[email protected]", to);
SmtpClient client = new SmtpClient();
client.Host = "smtpout.asia.secureserver.net";
//Tried "relay-hosting.secureserver.net" -Errors-Unable to connect
//Tried "smtpout.secureserver.net" -Errors-Unable to read data from the transport connection: net_io_connectionclosed
client.Port = 25;
//Tried 80, 3535, 25, 465 (SSL)
client.UseDefaultCredentials = false;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.EnableSsl = false;
client.ServicePoint.MaxIdleTime = 1;
client.Timeout = 1000;
client.Credentials = new NetworkCredential("[email protected]", "xxx-xxx");
mail.IsBodyHtml = true;
mail.Subject = "xxx-xxx.com Account Activation";

mail.Body = SomeBigHTMLstring;
client.Send(mail);
mail.Dispose();

and this is the error page am getting

enter image description hereenter image description here

Help me out guys.

2

2 Answers

6
votes

You can use port no : 3535 and EnableSSl:false after that is problem is resolved...

MailMessage mail = new MailMessage("[email protected]", to);
SmtpClient client = new SmtpClient();
client.Host = "smtpout.asia.secureserver.net";

// Tried "relay-hosting.secureserver.net" -Errors-Unable to connect
// Tried "smtpout.secureserver.net" -Errors-Unable to read data from
// the transport connection: net_io_connectionclosed

client.Port = 3535;  //Tried 80, 3535, 25, 465 (SSL)
client.UseDefaultCredentials = false;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.EnableSsl = false;
client.ServicePoint.MaxIdleTime = 1;
client.Timeout = 1000;
client.Credentials = new NetworkCredential("[email protected]", "xxx-xxx");
mail.IsBodyHtml = true;
mail.Subject = "xxx-xxx.com Account Activation";
mail.Body = SomeBigHTMLstring;
client.Send(mail);
mail.Dispose();

Happy coding... :-)

0
votes

Finally got it working.Two things to note

  1. The emails configured with "Relays" are only working this way as depicted below. enter image description here
  2. The Timeout needs to be increased.
client.Timeout = 10000;//was 1000 initialy