Email doesn't work after fresh install

I have 2 Digitalocean droplets.

  1. contains: dummydomain.com
  2. contains: sub.dummydomain.com

I verified both domains with my email provider. My app running on domain.com sends email as expected however, discourse app that is in sub.domain.com doesn’t send any email and i cannot see any useful log info about email failure.

When I try to send test email I get; There was a problem sending the test email. Please double-check your mail settings, verify that your host is not blocking mail connections, and try again.

My mail settings are:

  DISCOURSE_SMTP_ADDRESS: smtp.zoho.com
  DISCOURSE_SMTP_PORT: 587
  DISCOURSE_SMTP_USER_NAME: xx@.dummydomain.com
  DISCOURSE_SMTP_PASSWORD: xxdummypassword
  DISCOURSE_SMTP_ENABLE_START_TLS: true
  DISCOURSE_SMTP_AUTHENTICATION: "login"

I have tried everthing I have seen in this community, DO community and Stackoverflow. Even from the answers to the questions I asked there about this issue. Feeling frustrated now and wonder if it will ever work.

I decided to manually set up the admin through terminal, however, I cannot set any kind of email including user sign up, test email or anything else in discourse.

Any clue that could help?

Thanks

I fixed it by setting the email in the database itself using the rails console

rails r "SiteSetting.notification_email = 'email@here.com'"
4 Likes

OMG!! Thank you sooo much for this! I think I installed (the 30 minute version) at least 25 times, tried every trick in the book to solve this email issue… not to mention any small change in the setting requires a rebuild. As much I love the interface and the UX and what not, boy o boy the installation is anything but a straightforward process. That one line of rails code solved my problem as well. So thanks for sharing that! 3 days of googling, going through this forum finally concludes!

1 Like

Kindly help! How to open rails console??? :slightly_smiling:

Open rails console for discource by this command ./launcher enter app

int the console do the following,

rails c

rails r “SiteSetting.notification_email = ‘email@here.com’”

1 Like

Thank you so much for your quick reply! <3 I’ll just try that now!!! :slightly_smiling: Hope this works! You’re a live saver!

Do we have to use the double quotes? Like below

rails r “SiteSetting.notification_email = ‘email@here.com’”

OR like

rails r SiteSetting.notification_email = ‘email@here.com’

like this. rails r "SiteSetting.notification_email = ‘email@here.com’ "

OKEH :relaxed: Thank you so much!

Brother it gives this error that method R was not found…

Any idea? Would be really great ful!

are you using the docker standalone installation?

1 Like

Brother I followed this default guide and installed it manually. https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md

I have currently disabled emails.