Go to Site administration > Server > Email > Outgoing mail configuration
To get the SMTP servers functioning, only four values need to be set:
SMTP hosts: smtp.gmail.com:465 NOTE: Leave out the port (:465) in 1.9.2 or lower
SMTP security: SSL
SMTP username: Your email address @gmail.com or your own domain if using Google Apps
SMTP password: [YOUR APP PASSWORD. Read more about how to generate App Password below]
-
Sign in with App Passwords
An App Password is a 16-digit passcode that gives a less secure app or device permission to access your Google Account. App Passwords can only be used with accounts that have 2-Step Verification turned on.
Create & use App Passwords
Make sure you have the 2-Step Verification enabled on your Gmail account.
Go to your Google Account.
Select Security: https://myaccount.google.com/security
Select 2 Step-Verification. You may need to sign in and set up your account to proceed.
Upon accessing inside the 2-Step Verification scroll down and select App Passwords.
You may need to sign in. If you don’t have this option, it might be because:2-Step Verification is not set up for your account.
2-Step Verification is only set up for security keys.
Your account is through work, school, or other organization.
You turned on Advanced Protection.
OR click this: https://myaccount.google.com/apppasswords
At the bottom, choose Select app and choose "Other (custom name)" Moodle SMTP Generate.
Follow the instructions to enter the App Password. The App Password is the 16-character code in the yellow bar on your device.