Problem with direct email and nodemailer

Unfortunately mailgun is no longer as free as it once was. The first Ghost installs I’ve done use mailgun for free.

Now I have installed a new site with Ghost on a VPS.
I don’t need to send newsletters, I want to make new user registration, staff, password change work.

If I try to register a new user I get this error from frontend “Failed to send magic link email

The firewall is not active

From the logfile:

[....] "EmailError","statusCode":500,"level":"normal","message":"Failed to send email. Reason: Sending failed.","help":"\"Please see https://ghost.org/docs/config/#mail for instructions on configuring email.\"","stack":"Error: Sending failed\n    at createMailError (/var/www/domain/versions/5.53.3/core/server/services/mail/GhostMailer.js:68:12)\n    at DirectMailer.<anonymous> (/var/www/domain/versions/5.53.3/node_modules/nodemailer-direct-transport/lib/direct-transport.js:157:41)\n    at DirectMailer.<anonymous> (/var/www/domain/versions/5.53.3/node_modules/nodemailer-direct-transport/lib/direct-transport.js:228:30)\n    at /var/www/domain/versions/5.53.3/node_modules/nodemailer-direct-transport/lib/direct-transport.js:350:28\n    at callback (/var/www/domain/versions/5.53.3/node_modules/smtp-connection/lib/smtp-connection.js:374:14)\n    at /var/www/domain/versions/5.53.3/node_modules/smtp-connection/lib/smtp-connection.js:389:24\n    at SMTPConnection._actionSMTPStream (/var/www/domain/versions/5.53.3/node_modules/smtp-connection/lib/smtp-connection.js:1358:16)\n    at SMTPConnection.<anonymous> (/var/www/domain/versions/5.53.3/node_modules/smtp-connection/lib/smtp-connection.js:854:18)\n    at SMTPConnection._processResponse (/var/www/domain/versions/5.53.3/node_modules/smtp-connection/lib/smtp-connection.js:669:16)\n    at SMTPConnection._onData (/var/www/domain/versions/5.53.3/node_modules/smtp-connection/lib/smtp-connection.js:493:10)\n    at TLSSocket.emit (node:events:513:28)\n    at addChunk (node:internal/streams/readable:315:12)\n    at readableAddChunk (node:internal/streams/readable:289:9)\n    at TLSSocket.Readable.push (node:internal/streams/readable:228:10)\n    at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)","hideStack":false},"msg":"Failed to send email. Reason: Sending failed.","time":"2023-07-04T10:33:29.445Z","v":0}

My json file:

  "mail": {
    "transport": "Direct"
  },

I’ve read the documentation but I don’t understand what I have to do.
After installation Ghost should be able to send email or do I have to configure nodemailer somehow?

Thank you

I found this topic that can help those who have the same problem as me

Mailgun has a Flex option with first 1000 emails for free, but it’s kinda hidden. I wrote about it here:

1 Like

very interesting thanks, I’ll try it now.