AspEmail generates the following error when trying to send a message using an SMTP server requiring TLS:530 5.7.0 Must issue a STARTTLS command first
The Transport Layer Security (TLS) protocol encrypts all traffic between the email-sending application and SMTP server. TLS is the successor to SSL and very similar to it.Some SMTP servers including Google's popular free smtp.gmail.com require TLS and reject all non-TLS-compliant email clients by generating the error above.
The versions of AspEmail prior to 5.1 do not support TLS and therefore cannot be used with SMTP servers requiring it, including smtp.gmail.com.
AspEmail 5.1+ does support TLS. To use AspEmail with a TLS-enabled SMTP server, you need to set the property TLS to True, as follows:
Mail.Host = "smtp.gmail.com"
Mail.Username = "MyGmailAccount"
Mail.Password = "He!!o^World!"
Mail.TLS = True
...
Mail.SendTo download the latest version of AspEmail, please visit www.aspemail.com. Upgrades are free for registered users.