Cannot get email working on new install

after having read this article: Troubleshooting email on a new Discourse install I have followed all the steps mentioned, and yet the activation email is still not arriving.

I have the following entries:

DISCOURSE_SMTP_ADDRESS: (I have also tried
DISCOURSE_SMTP_PORT: 587 (I have also tried port 2525)

And I uncommented the line at the end of to read like this:

- exec: rails r "SiteSetting.notification_email=''"

Finally I tried this:

./launcher enter app
rails r "SiteSetting.notification_email = ''"

But, like I said, no activation email.

Thank you,

1 Like

this should be the web address of your SMTP mail provider, e.g.

These should be the user (often “SMTP_Injection”) & secret provided by your mail provider.

You will need to set up the correct TXT entry in your sites DNS too with a key provided by your mail provider then verify it at your mail account or it won’t accept requests.


All values there SMTP server address, password etc.) the are correct ones - I have changed to, and it still doesn’t work. Also, uncommenting that line at the end of app.yml as suggested above did not help. I just won’t get an activation email no matter what I try…

1 Like

Sascha please check you have opened the port on your server to ensure the requests are allowed to get out to your mail provider.


OK, how do I do that?

You need to modify the security settings in your cloud server account to allow SMTP inbound and outbound traffic on port 587. The interface to do this depends on your cloud provider.

NB some Cloud providers require you to send proof of ID before they will permit SMTP connectivity - this is true for e.g. Scaleway.


So, the cloud server running Discourse is on DigitalOcean, but my mail service is with A2 Hosting. That web server has nothing pre-installed, so I am not sure how to change any mail server settings. I did find an article on setting up a mail delivery agent:

Is that what I need to do in your opinion?

No, I don’t believe so, because you are not using your DO cloud server to do the actually forwarding of email to end users. Instead you using your mail service to do this (on A2hosting apparently) - a quick search of this meta brings up little on that service provider - you might want to contact their support?

Check your log for clues:

tail shared/standalone/log/rails/production.log

A2hosting doesn’t seem to be a popular mail service on here. Are you using it successfully for emails for other websites already? Using a well known dedicated email service may improve reliability of sending emails because some IP addresses get blacklisted for mail spam, so using a well managed brand of email service that polices itself is very important.

Have you considered alternatives?

Here’s the recommended list:

Although I use:


We don’t really want to change our hosting company (been happy with them for a long time, our entire e-commerce website depends on the way everything is set up and as you may have guessed I’m not a developer - so I’m afraid of breaking stuff ;-).

But I will contact them to say if they can point me in the right direction.

The production log has a lot of entries like:
ActionController::RoutingError (No route matches [POST] “azenv.php”)
(No route matches [HEAD]

BTW, my outgoing SMTP port is 465.

Thank you for your time responding to my question, it’s very much appreciated!

1 Like

Yes, check with their support team. Make sure the mail server login details are correct, the port is correct and if required you have set up the DNS properly and verify that with your mail provider.

1 Like

One more thing: in the example above, it states:
“Please note that in any email provider, you must verify and use the subdomain, e.g. . If you verify the domain only, e.g. , mail will not be configured correctly.”

I have tried that as well, but now in my app.yml I have my regular email address (without subdomain) under username and just uncommented the line toward the bottom that says:

rails r "SiteSetting.notification_email = ''"

Is that correct?

1 Like

I don’t have ‘discourse’ in my domain and it still works.

Mine is like : ‘’

But please note I have specifically set up a ‘sending domain’ with Sparkpost that is just ‘

This is specifically set up in a TXT record in DNS with a DKIM key Sparkpost provides and i’ve verified this domain using their website account functionality. FWIW I’ve set up the TXT record using an AWS Hosted Zone, but you could use any DNS tool …

1 Like

I’ve been struggling with this for more than three weeks now and am afraid I have to abandon my Discourse experiment. Nothing I tried worked. My email provider has confirmed that the settings I used are correct but they never found any email attempts (activation email) from Discourse on their server…


I feel your pain, we’ve been struggling for weeks also. We can send test emails but not activation emails. We’re resorting to hacking the core code to get emails to work.

1 Like

That sounds like sidekiq is not running.

1 Like

Sidekiq is running. No redis errors too.

I am not sure I have sidekiq installed. The locate command didn’t find anything. How can I check for that?

Would be good to add for exchange users to know they might need to switch to “login” authentication.
see this thread: SMTP connection problem, docker installation

1 Like

we actually liked Discourse so much that we wanted to replace our
existing forum ( ) with it. Since
we did not want to change our hosting service, we rented a 2GB
space on a Linux server (VPS cloud hosting) from Digital Ocean. I
then installed Docker as well as Discourse
( - so far, so good!

However, I never received an activation email. After a lot of
questions and answers
( ),
and endless modifications to the app.yml, rebuilds etc. etc. I
still could not make it work (tried different ports on the SMTP
server, edited email from to , uncommented that last line in the
app file and so on).

The problem is that I am not a developer and have very limited
knowledge of Linux and how to use a command line. I also have
only limited time to work through these issues, and I am thinking
that if getting email to work on Discourse is that hard for me,
what do I do when more serious problems arise. So, unfortunately,
in the end we probably have to keep our existing forum.

Discourse looks like a great product and perhaps one day it will be easier to install and run.

1 Like

IT is occasionally tricky, particularly integration. If you decide to go the self-install route you have to deal with the technical hurdles. None are insurmountable, even by non-devs. And not every developer is a good SA! :slight_smile: Your alternative is to use their full hosting service.

1 Like