I am trying to send emails via nodemailer without SMTP transport. So i\'ve done that:
var mail = require(\"nodemailer\").mail;
mail({
from: \"Fred Foo ✔ <
Looks like the the current nodemailer
does not have the option of sending mail without smtp any more. I would recommend take a look at the sendmail library which does NOT need any smtp/auth to send email. It gives you similar experience to using sendmail in linux.
const sendmail = require('sendmail')();
sendmail({
from: 'test@finra.org',
to: 'YourName@gmail.com',
subject: 'Hello World',
html: 'Hooray NodeJS!!!'
}, function (err, reply) {
console.log(err && err.stack)
console.dir(reply)
})
You can also turn on the silent
to make it less verbose: const sendmail = require('sendmail')({silent: true});
. One thing to notice is the sender cannot be those domains that has DMARC
policy like xxx@capitalone.com
.