The SMTP error 221 is an authentication error that can be caused by either of four reasons below:
First, verify that the SMTP username and password are correct. If your credentials are correct, then verify the SMTP server host. For example, if your sender account belongs to Google, use the Gmail SMTP host address (
If both the steps above are valid, ensure that you've enabled SMTP authentication for your account. For example, if your sender is a Gmail account, you must enable "Less Secure Sign-In Technology" for successful authentication.
Figure 01 - Turning on less secure app access
Finally, if none of this solves the error, try using SSL or TLS by configuring the port per your SMTP Server documentation. Sometimes, specific SMTP servers require either SSL or TLS to authenticate successfully. So, if you are sending an email with SSL via Google, use port 465, and if you are sending an email with TLS, use port 587.
View all errors