Bulk email for new post to free members doesn't work

I have tripled checked the mailgun API keys and they should be right. Signin, signup and subscribe messages work fine. But when I try to send a new post to free subscribers (I don’t have paid) it throws the following error. Has anyone experienced the same?

If you check your mailgun logs do you see if it gets to mailgun and having problems there? If it doesn’t even get to mailgun then it’ll be a problem with your settings in Ghost. It’s a place to start

Signin, signup, and subscribe are all transactional emails, they will use your mail settings from your config file. Sending bulk email to members will instead use the Mailgun settings configured in the admin interface, it sounds like the API key or domain that you’ve entered there is incorrect.

I am aware of difference, I also edited the email files in /core to translate them to my target language. I re-pasted the API key and domain 100x I don’t know where the error is. It’s a private API key right? I even tried with a Sending API key but nothing

What domain are you putting in? Sounds like that could be the problem.

mg.labioslivres.com and US region the site is https://labioslivres.com/


Is there a firewall or anything similar on your server that could be blocking outgoing connections to Mailgun’s API?

Not that I am aware of. It’s a pretty vanilla installation of ghost on DO

Have you checked your log files to see if there’s any details about the underlying error? https://ghost.org/docs/ghost-cli/#ghost-log

Just checked, I can see a new EmailError at createMailError and a bunch of other errors. What should I be looking for exactly? Very long log:)

I’ve your same exact problem, but looking at the credentials you are using for the mailgun config, the Mailgun domain should be something from the main mailgun domain AFAIK.
http://api.eu.mailgun.net/v3/your.domain.here should be the entry instead of your personal domain.
Try it and let us know! (in my case I’m based in europe so I added the eu. prefix, for US it should be empty e.g. http://api.mailgun.net/v3/your.domain.here)
For more info you can check the mailgun API documentation here

By the way this is not working for me neither, I’ve also repasted tons of time domain and API, nada :frowning:
It actually worked before upgrading to ghost4.0 - I’ve a self-hosted instance.

1 Like

Thanks for sharing @ntotao. What domain do we need to use @Kevin?
Btw these are the logs I get from the bulk mail error (first part):

{“name”:“Log”,“hostname”:“bloglabioslivres”,“pid”:4619,“level”:50,“err”:{“id”:“2c120380-696a-11eb-b9a6-cb2e5a5b7055”,“domain”:“https://labioslivres.com”,“code”:null,“name”:“EmailError”,“statusCode”:500,“level”:“normal”,“message”:“Failed to send email.”,“context”:"“Unable to send welcome email, your site will continue to function.”",“help”:"“Please see Configuration - Adapt your publication to suit your needs for instructions on configuring email.”",“stack”:"EmailError: Failed to send email.\n at EmailError.GhostError (/var/www/ghost/versions/3.41.3/node_modules/@tryghost/errors/lib/errors.js:10:26)\n at new EmailError (/var/www/ghost/versions/3.41.3/node_modules/@tryghost/errors/lib/errors.js:34:20)\n at createMailError (/var/www/ghost/versions/3.41.3/core/server/services/mail/GhostMailer.js:52:12)\n at EventEmitter.

The domain should be entered as it appears in Mailgun, as an example in the case shown in the image below the domain would be lookingsideways.co.uk.



Clicking the links under the fields in Ghost’s admin will take you to the respective areas of Mailgun’s admin for you to find the necessary domain/api key. For the API key make sure it’s a private API key, not a sending API key otherwise Ghost won’t be able to contact Mailgun’s API to fetch email analytics events.

That’s not related to the bulk email config, it’s your transactional email (welcome, signup, signin, staff invite, etc). Follow the link provided in the log for details on how to set it up https://ghost.org/docs/config/#mail

Thank you for this! I can’t believe I was making this wrong. I was sure to have read in two tutorials to insert the mailgun domain I indicated previously…
Thank you vary much!

Hi @Kevin, the transactional emails work fine. But I really cannot figure out the bulk email sendout, so can’t access the newsletter feature. Here’s what the logs look like. Any help would be much appreciated!!

Sounds like the domain entered in the Mailgun settings area in the admin panel has some invalid characters in it.

I swear I repasted them 10 times already

Could it be anything else @Kevin? I am really at a loss here