Email doesn't work after fresh install

docker
email

(Sunday T) #1

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


(Sunday T) #2

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

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

(Ajoy Thomas) #3

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!


(Hassam Ahmad Awan) #4

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


(Sunday T) #5

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’”


(Hassam Ahmad Awan) #6

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!


(Hassam Ahmad Awan) #7

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’


(Sunday T) #8

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


(Hassam Ahmad Awan) #9

OKEH :relaxed: Thank you so much!


(Hassam Ahmad Awan) #10

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

Any idea? Would be really great ful!


(Sunday T) #11

are you using the docker standalone installation?


(Hassam Ahmad Awan) #12

Brother I followed this default guide and installed it manually. discourse/INSTALL-cloud.md at master · discourse/discourse · GitHub

I have currently disabled emails.