SmtpClient: A connection attempt failed because the connected party did not properly respond after a period of time

The following code works for me. Your code was giving me errors, I believe it was due to not setting the port to 587. http://forums.asp.net/t/1250771.aspx/4/10 MailMessage mail = new MailMessage(); mail.To.Add(to); mail.From = new MailAddress(from); mail.Subject = subject; mail.Body = body; mail.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(“smtp.gmail.com”,587); smtp.EnableSsl = true; smtp.UseDefaultCredentials = false; … Read more

smtpclient ” failure sending mail”

Well, the “failure sending e-mail” should hopefully have a bit more detail. But there are a few things that could cause this. Restrictions on the “From” address. If you are using different from addresses, some could be blocked by your SMTP service from being able to send. Flood prevention on your SMTP service could be … Read more

Sending email fails when two factor authentication is on for Gmail

Create a custom app in you Gmail security settings. Log-in into Gmail with your account Navigate to https://security.google.com/settings/security/apppasswords In ‘select app’ choose ‘custom’, give it an arbitrary name and press generate It will give you 16 chars token. Use the token as password in combination with your full Gmail account and two factor authentication will … Read more

How to send email using simple SMTP commands via Gmail?

to send over gmail, you need to use an encrypted connection. this is not possible with telnet alone, but you can use tools like openssl either connect using the starttls option in openssl to convert the plain connection to encrypted… openssl s_client -starttls smtp -connect smtp.gmail.com:587 -crlf -ign_eof or connect to a ssl sockect directly… … Read more