I have little experience with C# and I am currently having an issue with sending an email from a button click to a specified address.
I have an ASP.NET webpage which contains a contact form. I want a user to enter data into text boxes and then when they click the "SEND" button this information is sent via email.
However when i click send i get the following.
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 209.85.229.109:25
The C# code is as follows.
protected void Button1_Click(object sender, EventArgs e)
{
    MailMessage mail = new MailMessage();
    mail.From = new MailAddress(txtemail.Text);
    mail.To.Add("hmgomez90@gmail.com");
    mail.Subject = "Taxi Taxi Support";
    mail.IsBodyHtml = true;
    mail.Body = "First Name: " + txtname.Text;
    mail.Body += "Email: " + txtemail.Text;
    mail.Body += "Comments: " + txtquestion.Text;
    SmtpClient smtp = new SmtpClient();
    smtp.Host = "smtp.gmail.com";
    smtp.Send(mail);
}
I am using the System.Net and System.Net.Mail
Any help will be greatly appreciated.
 
     
     
    