Introduction
This post explains how to configure gmail and moodle, so that we can use gmail as outgoing mail server for moodle. This is required so your application can send notifications via email. Find below an example of configuring the email using a Gmail account from the Moodle Administration Panel.
Steps – Tested on moodle 3.8
- Turn on less secure app access
- Configure moodle
- Testing configured mail server
1. Turn on less secure app access
To use gmail as a relay server we need to allow less secure app access.
Login to gmail -> Accounts -> Security and turn on the less secure app access

2. Configure Moodle
Login to Moodle
Navigate to Dashboard –> Site Administration –> Server –> outgoing mail Configuration
Enter the following values and save
SMTP Hosts : smtp.gmail.com:587
SMTP Security: TLS
SMTP Auth Type : Login
SMTP username :
<username>
SMTP Password :<password>
Now you have successfully configured the outgoing mail server.
3. Testing configured mail server
Login to Moodle
Navigate to Dashboard –> Site Administration –> Server –> Test outgoing mail server
Enter an test email and send a test message. You will receive a success message as follows. Now you have successfully configured outgoing mail server

Limitations of using gmail as outgoing mail server
- For personal account gmail imposes a daily limit of 500 emails
- Higher chances of blocking your gmail account when trying to send bulk email to users.
You can use other third party applications like Send Grid , Socket Labs to send the emails