Q: How to set up SMTP
When Moodle sends emails, it utilizes SMTP to dispatch them. So, how do you configure SMTP?

Configuring SMTP can be done in various ways. Here's an example using a Gmail account.
Generate an App Password for Your Gmail Account
First, log in to your Gmail account.
Once logged in, navigate to the account settings page and click on the "Security" tab.

Click on "2-step verification".

Scroll down to the bottom of the page and click on the "App passwords" section.

Enter a recognizable name in the "App name" field.

After entering the name, the system will generate a 16-character password. Please note that once you leave this window, you won't be able to return. Make sure to copy the password to a text document.

Next, please remove the spaces between the characters of the password.
(For example, if the password is "abcd efgh ijkl mnop," please change it to "abcdefghijklmnop.")

Setting up SMTP in Moodle
請管理員至 網站管理 > 主機 > 電子郵件 > 外送郵件配置,進行以下設定:
Admins should navigate to Site administration > Server > Email > Outgoing mail configuration
to perform the following settings:
- SMTP host: Enter "smtp.gmail.com:587"
- SMTP security: Choose "TLS"
- SMTP Auth Type: Choose "LOGIN"
- SMTP username: Enter your Google account (example format: abc@gmail.com)
- SMTP password: Enter the 16-character application password (e.g., abcdefghijklmnop)

Testing SMTP outgoing mail configuration
Navigate to Site administration > Server > Email > Outgoing mail configuration, and click on "Test outgoing mail configuration."

Enter the recipient's email address in the "To email address" field.

- If you see the following screen, it means the email has been sent successfully.

The content of the test email received:

- If you see the following screen, it means the email sending has failed. Please double-check the SMTP settings to ensure they are correct.
