Gmail side (use 2-Step Verification and generate app password) :
*Because Google stopped supporting “Less Secure Apps” as of May 30th, 2022, seems this is a MUST to config this.
- Google Account -> Security -> 2-Step Verification -> Input password as asked -> Turn ON (you could use SMS to get Gmail code to activate 2-Step Verification)
- Google Account -> Security -> 2-Step Verification -> App password -> Input password as asked -> Select the app as mail and device... -> e.g. Other(Custom name) -> Input app name e.g. MyApp -> Generate
- Copy a 16-character password
- Use a 16-character password with Gmail username (xxx@gmail.com) in Liferay side.
Google support link here.
Liferay side:
- Control Panel -> Server Administration -> Mail
1.1 Outgoing SMTP Server: smtp.gmail.com
1.2 Outgoing Port: 465
1.3 Use a Secure Network Connection: checked
1.4 User Name: xxx@gmail.com
1.5 Password: [Generated by Gmail side] - Control Panel -> Instance Settings -> Email -> Email Sender
- Send as xxx@gmail.com