I am trying to send a mail the form posts, but when the form posts it tries to send the mail and then times out. the code that is timing out is this:
MailMessage mail = new MailMessage();
mail.From = new MailAddress("someone@example.com");
mail.To.Add("someoneElse@example.com");
SmtpClient smtp = new SmtpClient();
smtp.Port = 465;
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.UseDefaultCredentials = false;
smtp.Host = "smtp.gmail.com";
mail.Subject = "Hello";
mail.Body = "World!";
smtp.Send(mail);