1
Reply

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

Ask a question
Kumar AU

Kumar AU

8y
414
1
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)