How to Configure SMTP for Discourse
Discourse as a forum application, Email service is a core feature for Discourse. This article will show you how to configure SMTP on Discourse. We use Gmail account for demostration. To configure Gmail account to Discourse, you have to create an app password on your Gmail account. Please refer to the Sign in with App Passwords guide to create the app password on your Gmail account.
1. Locate the application
Log in to the Client Panel and locate your target deployment on the Home page or the My Applications page.
2. Navigate to the "Shell / SSH" page
Click the "Manage" button on the Home page or the My Applications page. Then Click the "Shell / SSH" tab in the menu bar.
On the Shell / SSH page, you can see a "Connect" button, which is only open to the accounts that has passed our verification process for security reasons. To update your billing account information, please log in to the client panel.
Click the Connect button to initiate a shell session. You can issue commands in it.
3. Modify the discourse.conf file
Go to the config folder and find the discourse.conf file.
Modify the discourse.conf file by updating the content below:
Note: Please use the app password as smtp_password.
$ vim discourse.conf
smtp_address = smtp.gmail.com
smtp_port = 587
smtp_user_name = demouser@gmail.com
smtp_password = ny********
4. Restart all services
Run the command in the SSH
$ supervisorctl reload
It usually takes 1-2 minutes to restart all services in Discourse.
5. Verify successful configuration
Now you can sign in to your Discourse to verify it by sending a test email and checking it in the dashboard of your SMTP service provider.