Did you enter email settings correctly?
Double check the settings in your
containers/app.yml file. A valid email section looks like this:
Double-check all values for correctness. Note that it all aligns, there are no leading
# characters, and there are single quotes around the developer email field.
If you had any errors in your
app.yml and made changes , you MUST rebuild the container for those changes to take effect!
./launcher rebuild app
Are your SMTP connections being blocked?
To confirm that your server can indeed contact the email server, issue this command:
telnet smtp.mailgun.org 587
If you can't connect this way, you're almost certainly blocked. (And if you do get connected, the escape character for SMTP is ctrl+], then use
quit to exit telnet.)
If this happens, contact your cloud provider support and confirm that your email connections are not being blocked.
What do the Discourse logs say?
From the command line, issue this command:
This will show the last few lines of the log. Look for anything mail related. If you need to view the fuller logs, try
To page through the complete log by pressing space. Look closely for any email related messages.
What do your email provider logs say?
Assuming there are no errors in the Discourse logs, or your Discourse mail configuration, the emails probably went out. The question, is what did your email provider do with them?
Most email providers have a log viewing function. Check the logs for your email domain and see what happened with the incoming emails.
Did you properly set up DKIM and SPF records for your domain?
You must enter those crucial DNS records for DKIM and SPF, otherwise your emails may arrive only sporadically, if at all.
Is the email domain correct?
The default email from address is based on the install domain plus subdomain, so if your URL is
discourse.example.com it will be:
But if your mail provider is expecting:
.. you may have problems! To get around this, edit and uncomment this line in
## If you want to set the 'From' email address for your first registration, uncomment and change:
#- exec: rails r "SiteSetting.email@example.com'"
## After getting the first signup email, re-comment the line. It only needs to run once.
You'll need to issue a rebuild after uncommenting the above line and setting the from email address as required.
You can also change this from the command line, if needed:
./launcher enter app
rails r "SiteSetting.notification_email = 'firstname.lastname@example.org'"
If you are using Mailgun, have you activated your domain and provided credit card information?
If you are using Mailgun, after you enter your DKIM and SPF records, you must visit
https://mailgun.com/app/domains/YOUR.DISCOURSE.DOMAIN.com and click the "Check DNS Records Now" button. At the top of that page you should see "State ACTIVE" (in a calming green). If it says "State Unverified" (in a scary warning-yellow) Mailgun will not accept mail.
Mailgun now requires a credit card in order to deliver mail (other than to you). If your mailgun logs have a message about "free accounts," this is your problem.
Other mail services have similar requirements.
Are you using an IP address as the mail domain?
This does not work in our experience. You must use a domain name when sending email, not an IP address like
Need to log in without receiving an registration email?
We don't recommend this, because your email is still broken, and you have a broken Discourse until email is working. But if you absolutely must log in as admin with email broken, here's what to do:
./launcher enter app
and answer the prompts. It takes a few seconds before they appear. When it asks for the password, you will not be able to see what you type. That is why it makes you type it twice.
Email still doesn't work! What next?
Anything else I forgot here? Feel free to edit this.