This article describes some specific considerations you need to take into account when sending or receiving emails using a Google Account (Gmail, Google for Business, or any edition).
As of May 30th, 2022, Google will no longer provide access to less secure apps (here is the announcement). That is to say, you cannot authenticate by just assigning in the Username and Password properties of the SMTPSession or POP3Session the email and password of the Google Account.
One solution is to use, instead of the Google Account password, an Application Specific Password.
App Passwords can only be used with accounts that have 2-Step Verification turned on.
Sample code snippet setting properties to create a Pop3 session:
&Pop3Session.Host = 'pop.gmail.com'
&Pop3Session.Port = 995
&Pop3Session.Timeout = 30
&Pop3Session.UserName = 'email@example.com'
&Pop3Session.Password = 'abcdabcdabcdabcd' // 16-digit App password given by Google
Steps to get an App Password:
- Turn on 2-Step Verification in the Google Account
- Create an app password
- Use that password in the application (assigning it to the corresponding Password property).
Note: The above is valid for all versions of GeneXus..
This method, which the recommended by Google, is available as of GeneXus 17 Upgrade 9. It requires additional programming using the OAuth Module and also specific configurations to use latest libraries for sending and receiving emails. More information about this at
SAC 50932 - OAUTH support for sending and receiving mails