我正在编写脚本以使用 nodmailer 包从我的域发送电子邮件,我的代码如下:-
/************send email **************/
var nodemailer = require('nodemailer');
var transporter = createTransport('smtp://admin@digieasynow.com:paxxxxxxxxx
@mail.digieasynow.com');
var mailOptions = {
from: '"Tester 👥" admin@digieasynow.com',
to: 'example@gmail.com',
subject: 'Hello ✔',
text: 'Hello world 🐴',
html: 'Hello world 🐴'
};
transporter.sendMail(mailOptions,function(error, info){
if(error){
return console.log(error);
}
console.log('Message sent: ' + info.response);
});
/**End code here************/
运行时,出现以下错误:
Error: Hostname/IP doesn't match certificate's altnames: "Host: mail.digieasynow.com. is not in the cert's altnames: DNS:.webhostbox.net, DNS:webhostbox.net"
最佳答案
看来您可能需要升级到通配符 SSL 证书(涵盖 *.digieasynow.com)。这样您就可以使用任意数量的子域。
关于node.js - 无法使用 nodemailer 从我想要的域发送电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43958815/