Forum Discussion

juliemorris's avatar
juliemorris
Occasional Contributor
2 years ago
Solved

Emailing from Gmail

Hi,

 

To send emails using a gmail account, TestComplete instructions (https://support.smartbear.com/testcomplete/docs/scripting/sending-email-from-scripts.html) advise that the gmail account needs to be setup with Allow Less secure apps saying "If you send messages from a Gmail address, the Allow less secure apps option must be enabled for your account:".

 

However as at 30 May 2022, Google have disabled this feature on gmail accounts, saying
"To help keep your account secure, from May 30, 2022, ​​Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password."

 

Does anyone have a workaround to allow gmail to be used to send emails?

  • To fix this, you just need to create an App password on the Google gmail account.

    Create & use App Passwords
    1. Go to your Google Account.
    2. Select Security.
    3. Under "Signing in to Google," select App Passwords. You may need to sign in. ...
    4. At the bottom, choose Select app and choose the app you using Select device and choose the device you're using. ...
    5. Follow the instructions to enter the App Password. ...
    6. Tap Done.

    This will create a password for you and then you just use your normal gmail account in your code: 

     

3 Replies

    • juliemorris's avatar
      juliemorris
      Occasional Contributor

      Thanks Marsha, I have just done this. Hopefully they have a fix.

  • juliemorris's avatar
    juliemorris
    Occasional Contributor

    To fix this, you just need to create an App password on the Google gmail account.

    Create & use App Passwords
    1. Go to your Google Account.
    2. Select Security.
    3. Under "Signing in to Google," select App Passwords. You may need to sign in. ...
    4. At the bottom, choose Select app and choose the app you using Select device and choose the device you're using. ...
    5. Follow the instructions to enter the App Password. ...
    6. Tap Done.

    This will create a password for you and then you just use your normal gmail account in your code: