[英]How to send direct email with DKIM enabled with nodemailer?
我如何通过启用DKIM的nodemailer
发送直接电子邮件?
我试过了
const nodemailer = require('nodemailer')
const directTransport = require('nodemailer-direct-transport')
const transporter = nodemailer.createTransport(
directTransport({
dkim: {
domainName: "mydomain.com",
keySelector: "mail",
privateKey: "<generated private key>"
}
}))
require('express')().get('/test', (req, res, next) => {
console.log('sending mail')
mailer.sendMail({
from: 'support@mydomain.com',
to: 'pmmEoRzqH5EyTO@dkimvalidator.com',
subject: 'test email',
html: 'Email content'
}, (err, reply) => {
console.log('email sent')
console.log(err && err.stack)
console.dir(reply)
})
res.send('test').end()
})
当我在http://dkimvalidator.com/results检查时,电子邮件已发送但没有DKIM。
DKIM信息:DKIM签名
此消息不包含DKIM签名
有没有人成功做到这一点? 这看起来是一种无需设置SMTP服务器即可直接发送电子邮件的廉价方法,但我没有看到任何相关信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.