Problem sending mail from Ghost

Hello. My version is 3.40.1
Sending mail from the server does not work for me. When trying to change in the admin part (Enable members) Email addresses
Contact information used for newsletters and member login emails throws an error and the address is not saved. Sending mail from the frontend also does not work. In the configuration file, I tried to configure sending from another server through the SMTP, it also did not help. Here is my log log.


[2021-01-09 09:05:28] INFO “GET /members/api/site/” 304 1ms
[2021-01-09 09:05:28] WARN Cookie ghost-members-ssr not found
[2021-01-09 09:05:28] INFO “GET /members/api/member/” 400 1ms
[2021-01-09 09:05:29] INFO “GET /content/images/size/w1000/2021/01/demo.gif” 302 1ms
[2021-01-09 09:05:44] INFO “PUT /ghost/api/v3/admin/settings/” 200 82ms
[2021-01-09 09:05:44] WARN Cookie ghost-members-ssr not found
[2021-01-09 09:05:44] INFO “GET /” 200 189ms
[2021-01-09 09:06:34] INFO “PUT /ghost/api/v3/admin/settings/” 200 102ms
[2021-01-09 09:06:37] INFO “PUT /ghost/api/v3/admin/settings/” 200 92ms
[2021-01-09 09:06:40] WARN Cookie ghost-members-ssr not found
[2021-01-09 09:06:40] INFO “GET /” 200 204ms
[2021-01-09 09:06:40] INFO “GET /content/images/size/w30/2021/01/demo.gif” 302 2ms
[2021-01-09 09:06:40] INFO “GET /members/api/site/” 304 1ms
[2021-01-09 09:06:41] WARN Cookie ghost-members-ssr not found
[2021-01-09 09:06:41] INFO “GET /members/api/member/” 400 1ms
[2021-01-09 09:06:41] INFO “GET /content/images/size/w1000/2021/01/demo.gif” 302 1ms
[2021-01-09 09:06:53] ERROR

NAME: EmailError
MESSAGE: Failed to send email.

level: normal

“Please see Configuration - Adapt your publication to suit your needs for instructions on configuring email.”
EmailError: Failed to send email.
at EmailError.GhostError (/var/www/xxxxxx/versions/3.40.1/node_modules/@tryghost/errors/lib/errors.js:10:26)
at new EmailError (/var/www/xxxxxx/versions/3.40.1/node_modules/@tryghost/errors/lib/errors.js:34:20)
at createMailError (/var/www/xxxxxx/versions/3.40.1/core/server/services/mail/GhostMailer.js:52:12)
at EventEmitter. (/var/www/xxxxxx/versions/3.40.1/core/server/services/mail/GhostMailer.js:114:24)
at Object.onceWrapper (events.js:421:26)
at EventEmitter.emit (events.js:314:20)
at EventEmitter.emit (domain.js:483:12)
at DirectMailer. (/var/www/xxxxxx/versions/3.40.1/node_modules/directmail/lib/mailer.js:174:38)
at SMTPClient. (/var/www/xxxxxx/versions/3.40.1/node_modules/directmail/lib/mailer.js:292:13)
at Object.onceWrapper (events.js:420:28)
at SMTPClient.emit (events.js:314:20)
at SMTPClient.EventEmitter.emit (domain.js:483:12)
at SMTPClient._destroy (/var/www/xxxxxx/versions/3.40.1/node_modules/simplesmtp/lib/client.js:310:10)
at SMTPClient._onEnd (/var/www/xxxxxx/versions/3.40.1/node_modules/simplesmtp/lib/client.js:410:10)
at Socket.emit (events.js:326:22)
at Socket.EventEmitter.emit (domain.js:483:12)

[2021-01-09 09:06:53] INFO “POST /members/api/send-magic-link/” 500 802ms
[2021-01-09 09:07:00] WARN Cookie ghost-members-ssr not found
[2021-01-09 09:07:00] INFO “GET /rss/” 200 182ms


This problem appeared out of nowhere, everything worked yesterday. And today this problem has appeared.

@javi had the same issue a few days ago and we tried to debug it, but we didn’t manage.

I see some other people are reporting similar issues on the forum, there might be a bug somewhere.

How do I set up mail?
Everything is correctly indicated in the documentation.
You have two options or Mailgun or any other SMTP server of yours.

#Send from local server
// config.production.json

“mail”: {
“transport”: “Direct”
},

Here is the Mailgun variant.
#Register on Mailgun and change // config.production.json

“mail”: {
“transport”: “Direct”
},

#On // config.production.json

“mail”: {
“transport”: “SMTP”,
“options”: {
“service”: “Mailgun”,
“auth”: {
“user”: “postmaster@example.mailgun.org”,
“pass”: “1234567890”
}
}
},

Then, in the admin panel, add the desired mail and register the domain and Mailgun keys

Sending from your SMTP // config.production.json

“mail”: {
“transport”: “SMTP”,
“options”: {
“host”: “YOUR-SES-SERVER-NAME”,
“port”: 465,
“service”: “SES”,
“auth”: {
“user”: “YOUR-SES-ACCESS-KEY-ID”,
“pass”: “YOUR-SES-SECRET-ACCESS-KEY”
}
}
}
From address

Important: “service”: “SES”,

About the proxy. Installation and configuration should be done with the proxy disabled.

Enjoy your work and good mood.
https://pintait.com/

I am running on docker/self-hosted.
With port 465 587 both tested, but not working,
on same server I have different apps, and it worked fine with same cofig, but ghost it is bit magic error :slight_smile:
Env file.
image

console

Console

This is the error:

RecipientError: Can't send mail - all recipients were rejected

Suggests your mail provider is not fully set up or has restrictions meaning it’s unable to send to the email addresses you’re trying to send to.

Thanks,
I have solved it by doing the following changes on mailcow.

But also found some interesting approach in SMTP logs.
I didn’t enter anywhere noreply mail in ghost,
This was occurred while I was changing support mail, it automatically tries to send mail on behalf of noreply.

What do you mean mail provider is not fully setup? Doesn’t ghost use it’s own mail provider nodemailler under the hood? In that case that is not fully setup?

You have to tell Ghost how you want your email sent. (By editing config.production.json or config.development.json, found in your Ghost folder.)

Nodemailer alone can’t deliver emails anywhere without configuration. It needs to hand those emails off to somewhere. If you haven’t done any work on the config file, Ghost may be trying to talk to a mail server that isn’t accepting email from it. If you post your config.whatever.json file and more about your hosting setup, including what if any errors are in your Ghost logs and your email server’s logs, we can try to help you. Be sure to indicate (since you reopened an old thread) whether your problem is transactional email or bulk email or both, please.