Harish Batchu

Harish Batchu

  • NA
  • 255
  • 70.9k

When sending a mail to through godaddy server?

Oct 23 2018 4:15 AM
 
error:
 
"Failure sending mail." 
 
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 72.167.234.197:25
 
MailMessage Msg = new MailMessage();
MailAddress fromMail = new MailAddress("xxxx");
// Sender e-mail address.
Msg.From = fromMail;
// Recipient e-mail address.
Msg.To.Add(new MailAddress(Email));
// Subject of e-mail
Msg.Subject = "something";
Msg.Body = "This Sample";
Msg.IsBodyHtml = true;
SmtpClient mailClient = new SmtpClient("relay-hosting.secureserver.net", 25);
// Change your gmail user id and password for send email
NetworkCredential NetCrd = new NetworkCredential(xxxxx", "yyyyyyyy");
mailClient.UseDefaultCredentials = false;
mailClient.Credentials = NetCrd;
mailClient.EnableSsl = true;
mailClient.DeliveryMethod = SmtpDeliveryMethod.Network;
mailClient.Send(Msg);
 
help me out 
 

Answers (1)