Question

How can I replace the smtp server installed in discourse?

hi. I installed it on the open source discourse. The smtp server used Mailgun Free ver. The mailgun Free ver. smtp installed on discourse is not sending mail, so I want to change the smtp server.

Free mailgun smtp server is not working on discourse anymore?

How can I replace the smtp server installed in discourse?


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

KFSys
Site Moderator
Site Moderator badge
June 22, 2023

Hey @bubblylightcyanraft,

Before changing the SMTP settings and Free Mailgun, I’ll recommend checking them to see if they are correct according to Free Mailgun’s documentation.

The SMTP settings can be found following these steps

Navigate to the directory where your app.yml is located.

Open the app.yml file with a text editor like nano or vi. For example: nano app.yml

Find the following lines in the file and update the SMTP server’s details:

DISCOURSE_SMTP_ADDRESS: smtp.mailprovider.com       # change mailprovider.com to your SMTP server
DISCOURSE_SMTP_PORT: 587                           # adjust if your provider uses a different port
DISCOURSE_SMTP_USER_NAME: user@example.com         # your SMTP username
DISCOURSE_SMTP_PASSWORD: a-super-secret-password   # your SMTP password
DISCOURSE_SMTP_ENABLE_START_TLS: true

After you’ve made your changes, save and close the file.

From the /var/discourse directory, rebuild the Discourse container with the command ./launcher rebuild app. This will apply the changes.

Remember to replace the placeholder values with the actual SMTP settings provided by your new email service provider. You can generally find these details in the documentation or settings section of your provider’s website.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel