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.
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”: “postmaster@mg.bryanhogan.me”,
“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?
Okay, so you have set up Mailgun for transactional email. However, for this to work, you’ll need to make sure you’ve setup DNS correctly for your domain. Additionally, try port 465, and make sure you have outgoing firewall rules setup for these ports.
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.
No. However, port 465 is implicitly a TLS connection (whereas 587 is STARTTLS, which means the conversation starts in plain text.) The preferred port nowadays is 587, but 465 does work with Mailgun. What happens if you change to "secure": "true",?
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.
I had the exact same problem. It was mailgun. My free mailgun trail was expired and I saw the same error message. I didn’t want to use mailgun because it was way to expensive for me. So i chose Amazon Simple Email Service (SES). It is easy to setup and way too cheaper.
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:
NAME: EmailError
CODE: EENVELOPE
MESSAGE: Failed to send email. Reason: Can't send mail - all recipients were rejected: 553 5.7.1 <noreply@myDomain.com>: Sender address rejected: not owned by user info@myDomain.com.
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 <noreply@myDomain.com>: Sender address rejected: not owned by user info@myDomain.com
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)