Closed rudimadima closed 1 year ago
smtp-server is a library to create SMTP interfaces for other apps. It does not deliver anything itself, it accepts messages and passes these to you app for further processing.
EDIT : you can use https://github.com/guileen/node-sendmail to send email, don't forget to setup dns records. Btw smtp-server is perfect to receive emails and store them in a database.
const sendmail = require('sendmail')({
logger: {
debug: console.log,
info: console.info,
warn: console.warn,
error: console.error
},
silent: false
});
sendmail({
from: 'no-reply@example.pro',
to: 'somegmailaccout@gmail.com',
subject: 'Please, work!',
html: 'It worked',
}, function(err, reply) {
console.log(err && err.stack);
console.dir(reply);
});
I was also looking for a way to send emails and just found out it's not possible with smtp-server.
https://nodemailer.com/extras/smtp-server/
This is not a full-blown server application like Haraka but an easy way to add custom SMTP listeners to your app. This module does not make any email deliveries by itself. smtp-server allows you to listen on ports 25/24/465/587 etc. using SMTP or LMTP protocol and that's it. Your own application is responsible of accepting and delivering the message to destination.
Hi. I have installed Postfix on my VPS, I created SPF and PTR records in my domain and emails are normally sent from my server to gmail via Postfix. But I want to replace Postfix with
smtp-server
. But no matter what I do, emails are not sent to gmail!My transporter:
Use of transporter:
My smtp-server:
It accepts nodemailer transporter, but doesn't make deliveries to gmail. What can I do to fix it?