New setup - errors when trying to send emails through gmail


I’ve set up discourse on my private cloud in ubuntu server 16.04. All installed were fine.
I have a problem now when trying to test email part. I entered the correct informations but i don’t receive the emails. I used the same config in another nodejs application, and it works fine.
Where did I go wrong ?

Here is my config :


I am pretty stuck. Thank you in advance for your replies.

Using Gmail as your smtp server is against gmail terms of service and is unsupported.

1 Like

I used the same config in nodejs app. I authorized using this kind of application in my account security and it works fine.
Is discourse not supported in gmail application even if i checked the less secure application in gmail configuration ? In this case, which config shoud i use ?

I’m not sure why it worked in your other app, but it’s still a violation of the terms of service at Gmail. For a list of recommended mail services see discourse/ at master · discourse/discourse · GitHub

Are you sure about that? I just found these limitations:

Gsuite and Gmail aren’t the same thing. It looked like you’re using Gmail from your example above.

Using a mail service will be easier. If you don’t want an easy solution to your problem of getting mail to work, then my advice isn’t helpful.


@canapin the username listed above is, gsuite documentation doesn’t apply, gsuite is their paid service, so yes it’s in breach of their ToS.

We can’t help you break the very reasonable rules Google lays out, particularly when there are free and supportable alternatives.

1 Like

Thank you for your response. I tried with Gsuite but it doesn’t work too. I did use an email adress added with Gsuite and allowed smtp to be used from external apps. The result is the same.
I think i will try sendGrid or something else that discourse handle.

I don’t recommend using GSuite to send mail, but a client recently followed these instructions and is sending mail with GSuite.

1 Like

I followed the same instructions in this link but i still have the same problem. So, i created a new account in mailjet. When i start now ./discourse-doctor it tells me that the email has been sent. But i still recieve nothing in my email box.i also add a new DNS config for mailjet to allow adress with my domain to be able to send email but still nothing has been sent, even if it tells that email was sent.
PS: my spam is empty.

In my opinion it’s just a no-go using Gmail OR Gsuite as transactional mail service for ANY website, including Discourse, it’s not what it’s meant for!

Try Mailgun (it’s even free for 10k emails a month!), or see this article for alternatives.

That’s not accurate.

GSuite does allow email to be sent, hence the document linked above. Go over their limits though and the rest of your gsuite account can end up being limited.

One of the recommended mail providers is preferable, if you choose to use something else it’s on you to make it work.

1 Like

Maybe not accurate, but no professional will advise to use Gmail or Gsuite to send transactional email. That’s why my opinion is that this is a no-go, ofcourse if TS wants to make it work, up to him!

Then please don’t pass off opinion as fact.

TIL I’m not a professional ¯\_(ツ)_/¯

You’ll need to look at your logs at Mailjet. Like Discourse-doctor said, it’s not a problem with Discourse.

Agreed. (Except for some low-volume hobbyist site, maybe. Even then, it’s easier to set up Mailgun or similar.)