Persits Software, Inc. Knowledge Base Articles

530 5.7.0 Must issue a STARTTLS command first error

Problem Description

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 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

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 = ""
Mail.Username = "MyGmailAccount"
Mail.Password = "He!!o^World!"
Mail.TLS = True

To download the latest version of AspEmail, please visit Upgrades are free for registered users.