Q: How to set up SMTP

When Moodle sends emails, it utilizes SMTP to dispatch them. So, how do you configure SMTP?

生成16位密碼
Preparation time
10 minutes
Difficulty
Easy
Directions

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.

Google帳戶_安全性

 

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.

生成16位密碼

 

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)
SMTP設定

 

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:

收到email信件

 

  • If you see the following screen, it means the email sending has failed. Please double-check the SMTP settings to ensure they are correct.
測試發信_失敗