Kumar AU

Kumar AU

  • 1.4k
  • 320
  • 63k

we can't send an email using GMAIL account in godaddy

Dec 13 2015 12:07 PM
Hi Team,
I have been struggling since 1 week, I am not able to send an email from Godady to using my Gmail account, please find my code below:
My Code :-
MailMessage msg = new MailMessage();
//Add your email address to the recipients
msg.To.Add("[email protected]");
//Configure the address we are sending the mail from
MailAddress address = new MailAddress("[email protected]");
msg.From = address;
msg.Subject = "Enquiry ";
msg.Body = "Hello Testing ";
SmtpClient client = new SmtpClient();
client.Host = "relay-hosting.secureserver.net";
client.Port = 25;
//Send the msg
client.Send(msg);
//Display some feedback to the user to let them know it was sent
lblResult.Text = "Your message was sent!";
--------------------------------------------------------- 
 
 

Answers (1)