I’m trying to set email sending on Ghost running inside docker (behind reverse proxy and cloudflare).
I’m using smtp2go as an smtp provider and I use credentials that work in other container (Bookstack). Here are the variables I pass to container:
mail__from: user@mydomain.com
mail__options__auth__user: username
mail__options__auth__pass: password
mail__options__host: mail.smtp2go.com
mail__options__port: 465
mail__options__secure: true
mail__options__service: smtp2go
mail__options__transport: SMTP
Here are the errors I see in the logs when attempting to send message:
[2024-08-09 16:44:06] ERROR "POST /ghost/api/admin/invites/" 500 2865ms
Error sending email: Failed to send email. Reason: Sending failed. Please check your email settings and resend the invitation.
"Please see https://ghost.org/docs/config/#mail for instructions on configuring email."
Error ID:
97b72c10-566e-11ef-9a09-ade95c20340c
----------------------------------------
Error: Sending failed
at createMailError (/var/lib/ghost/versions/5.89.0/core/server/services/mail/GhostMailer.js:105:12)
at DirectMailer.<anonymous> (/var/lib/ghost/versions/5.89.0/node_modules/nodemailer-direct-transport/lib/direct-transport.js:157:41)
at DirectMailer.<anonymous> (/var/lib/ghost/versions/5.89.0/node_modules/nodemailer-direct-transport/lib/direct-transport.js:228:30)
at /var/lib/ghost/versions/5.89.0/node_modules/nodemailer-direct-transport/lib/direct-transport.js:350:28
at callback (/var/lib/ghost/versions/5.89.0/node_modules/smtp-connection/lib/smtp-connection.js:374:14)
at SMTPConnection.<anonymous> (/var/lib/ghost/versions/5.89.0/node_modules/smtp-connection/lib/smtp-connection.js:385:20)
at SMTPConnection._actionRCPT (/var/lib/ghost/versions/5.89.0/node_modules/smtp-connection/lib/smtp-connection.js:1313:20)
at SMTPConnection.<anonymous> (/var/lib/ghost/versions/5.89.0/node_modules/smtp-connection/lib/smtp-connection.js:1265:26)
at SMTPConnection._processResponse (/var/lib/ghost/versions/5.89.0/node_modules/smtp-connection/lib/smtp-connection.js:669:16)
at SMTPConnection._onData (/var/lib/ghost/versions/5.89.0/node_modules/smtp-connection/lib/smtp-connection.js:493:10)
at TLSSocket.emit (node:events:517:28)
at TLSSocket.emit (node:domain:489:12)
at addChunk (node:internal/streams/readable:368:12)
at readableAddChunk (node:internal/streams/readable:341:9)
at Readable.push (node:internal/streams/readable:278:10)
at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)
Has anyone managed to set up Ghost with smtp2go or any ideas what am I doing wrong?