Error: Can't Remove Mailgun and configure Email on My Self-Hosting

Hello,

I’ve been trying a lot of things to fix SMTP, and just can’t make it work again. Last night I had fixed the SMTP configuration and it was alright.

Problem: The other person who works with me, tried today to configure the Mailgun without telling me. Now, after I’ve removed everything from the Ghost related to Mailgun (or atleast I believe so), it’s still giving me this error when I try to add new members.

“Failed to send invitation
Check your Mailgun configuration.”

When I try to get a new password, the error it’s the following:

“Failed to send email. Reason: Invalid login: 535 Incorrect authentication data.”

And on the log, I get the following error:
"NAME: EmailError
CODE: EAUTH
MESSAGE: Failed to send email. Reason: Invalid login: 535 Incorrect authentication data.

level: normal

“Please see Configuration - Adapt your publication to suit your needs for instructions on configuring email.”
Error: Invalid login: 535 Incorrect authentication data
at createMailError (/home/atelept1/public_html/current/versions/5.95.0/core/server/services/mail/GhostMailer.js:105:12)
at SMTPConnection._formatError (/home/atelept1/public_html/current/versions/5.95.0/node_modules/nodemailer/lib/smtp-connection/index.js:807:19)
… and it continues"

My config.production.json its configure with the following:

““mail”: {
“transport”: “SMTP”,
“from”: “admin@",
“options”: {
“host”: “cpp35.webserver.pt”,
“port”: 465,
“secure”: true,
“auth”: {
“user”: "admin@
*”,
“pass”: “*****”
}
}
},”

I’ve also tried to change “port” in here to something wrong, and in fact, it gives me an error. But right, now it’s back to the right now, “465”.

Can you guys help me? Basically, I want to work with my SMTP of my Cpanel, and not using Mailgun.

Thank you

Did you restart the server after changing the config file?

1 Like

Thank you.
Yes, using “ghost restart”.

Could it be ghost cache?

Restarting should get you a fresh read of the config file.

I’m wondering if Ghost is actually trying to use Mailgun, or if the error message is wrong.

The error message indicates a problem with username or password. Are those the settings and ports recommended by your host?

Thank you for the help, it’s solved.

The Cpanel was putting everything on cache. The problem was there.

Thank you

1 Like