添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Hello,
I’m trying to make it possible that members can sign up for my page and receive the newsletter.
Sadly whenever I try to sign-up it shows me the error “Failed to send magic link email”.

Now I’m at a loss on how to fix this issue and where to even look. Sending test mails through Mailgun works. I use the Ghost CMS droplet from Digital Ocean. My Ghost version is 5.2.2.

This is how the error looks like:
image 2024×1184 376 KB

If I could get any help on this I would appreciate it A LOT. Even just a hint to where to problem comes from would be amazing!

Have you configured Ghost to use Mailgun for transactional emails, or are these handled by your server?

The easiest way to check is to look at production.config.json under Mail.

If you haven’t setup an MTA this will probably fail. Mailgun needs configuring, but not through the admin pages. See the documentation:

Ghost - The Professional Publishing Platform

I don’t know how transactional Email are configured. I just setup Ghost cms over digital ocean, added Stripe and then added Mailgun like it is explained in the Ghost docs. Is there something that is that I am missing? What is an MTA?
I have configured the config.production.json. The mail part looks like this:
“mail”: {
“transport”: “SMTP”,
“options”: {
“service”: “Mailgun”,
“host”: “ smtp.eu.mailgun.org ”,
“port”: 587,
“secure”: “true”,
“auth”: {
“user”: “ [email protected] ”,
“pass”: “”

I think I found something. Changing the port to 465 and secure to “false” in the config.production.json file fixes the error.
But setting to secure to “false” is not optimal, right?

Bryan0:

I think I found something. Changing the port to 465 and secure to “false” in the config.production.json file fixes the error.
But setting to secure to “false” is not optimal, right?

Using port 465 for SMTP is out of date and deprecated and should be used unless necessary, so yes, it could cause a problem later.

This is a good time to learn where the logs for your ghost service or started.

You could try ghost ls to list your ghost instances and then ghost log [name] to review the logs. That might work if you didn’t set up a systemd service to management.

Systemd is helpful to make sure the service starts at boot and gets restarted if it crashes. The systemd service is set up for you when running ghost setup .

I just checked more config, and I’m using 465. I have a feeling I had an issue with 587, but can’t remember for sure.

Furthermore, I’ll change to 587, and provide an update.

Edit : 587 doesn’t work for me either. I’ll need to look into this as port 465 is no longer RFC compliant as @markstos alluded.

I’m trying to get 587 working on my server.

First, I checked that I could communicate with Mailgun:

telnet smtp.eu.mailgun.org 587

Since this worked, that would rule out Linode blocking the port, so the problem should to be on my setup. However, I’m having trouble getting things to work consistently, so I think this is something for the weekend. :slight_smile:

For Gmail, remove the host, port, and secure options:

     "mail": {
       "from": "'X X' <[email protected]>",
       "transport": "SMTP",
       "options": {
         "service": "Gmail",
         "auth": {
           "user": "X",
           "pass": "X"
              

If you are hosting your website in a docker container, you can set environment variables to setup email, s3 storage, database and more.
Screenshot 2022-08-26 at 2.59.15 PM1590×1240 178 KB

I am getting this error as well. To solve this, I added my Namecheap - Private email smtp info and started to get another error. I simply want to activate comment feature, not into bulk emailing at the moment. Anyone has an idea why this happens?

I replaced my domain with myDomain in following snippets.
SMTP setting:

"mail": {
    "transport": "SMTP",
    "options": {
      "service": "Privateemail",
      "host": "mail.privateemail.com",
      "port": 465,
      "secure": true,
      "auth": {
        "user": "[email protected]",
        "pass": "password"

Error log:

NAME: EmailError
CODE: EENVELOPE
MESSAGE: Failed to send email. Reason: Can't send mail - all recipients were rejected: 553 5.7.1 <[email protected]>: Sender address rejected: not owned by user [email protected].
level: normal
"Please see https://ghost.org/docs/config/#mail for instructions on configuring email."
Error: Can't send mail - all recipients were rejected: 553 5.7.1 <[email protected]>: Sender address rejected: not owned by user [email protected]
    at createMailError (/var/www/ghost/versions/5.11.0/core/server/services/mail/GhostMailer.js:67:12)
    at SMTPConnection._formatError (/var/www/ghost/versions/5.11.0/node_modules/nodemailer/lib/smtp-connection/index.js:787:19)
    at SMTPConnection._actionRCPT (/var/www/ghost/versions/5.11.0/node_modules/nodemailer/lib/smtp-connection/index.js:1629:28)
    at SMTPConnection.<anonymous> (/var/www/ghost/versions/5.11.0/node_modules/nodemailer/lib/smtp-connection/index.js:1582:30)
    at SMTPConnection._processResponse (/var/www/ghost/versions/5.11.0/node_modules/nodemailer/lib/smtp-connection/index.js:950:20)
    at SMTPConnection._onData (/var/www/ghost/versions/5.11.0/node_modules/nodemailer/lib/smtp-connection/index.js:752:14)
    at TLSSocket.SMTPConnection._onSocketData (/var/www/ghost/versions/5.11.0/node_modules/nodemailer/lib/smtp-connection/index.js:191:44)
    at TLSSocket.emit (events.js:400:28)
    at addChunk (internal/streams/readable.js:293:12)
    at readableAddChunk (internal/streams/readable.js:267:9)
    at TLSSocket.Readable.push (internal/streams/readable.js:206:10)
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23)