Programming, error messages and sample code
Gmail is disabling Less Secure Apps: How to send SMTP emails with APP Passwords
Programming, error messages and sample code > sample code
To help keep your account secure, starting May 30, 2022, ??Google will no longer support the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.
To use your Google Account in an SMTP code, please follow these steps to generate an App Password.
An App password is a 16-digit passcode that gives a non-Google app or device permission to access your Google Account. Learn more about how to sign in using App Passwords.1. Go to your Google Account. 2. Select Security. 3. Under "How you sign in to Google", turn on "2-Step Verification", follow up the upcoming pages to complete. 4. Go back to "How you sign in to Google", enter "2-Step Verification" again. 5. Scroll down to the bottom of the page, and click on "App passwords" 6. Type any App name you want, then click on "Create". 7. You will get a 16-digit passcode, copy it and use it as SMTP password of your Gmail account in your scripts. Please note there is NO whitespace when using the passcode, the code in the screenshot is more readable. If you get a problem or if you have any questions, please contact our support.