nodemailer nodejs: sendmail exited with 127

nodemailer nodejs: sendmail exited with 127

本文关键字:with exited sendmail nodejs nodemailer      更新时间:2023-09-26

我想从我的服务器(kimsufi)发送电子邮件以确认注册。

所以,我使用nodemailer https://github.com/andris9/Nodemailer

我有这个错误:

Error occured
Sendmail exited with 127

什么意思?

谢谢!

如果您正在使用此示例https://github.com/andris9/Nodemailer/blob/master/examples/example_sendmail.js

然后替换此代码

var transport = nodemailer.createTransport("Sendmail", "/usr/sbin/sendmail");

var transport = nodemailer.createTransport("SMTP", {
    host: "smtp.gmail.com", // hostname
    secureConnection: true, // use SSL
    port: 465, // port for secure SMTP
    auth: {
        user: "foo@rcorp.co.in",
        pass: "fooP@ssword"
    } });

确保您的发送邮件路径正确。要进行检查,请打开终端并发出:

which sendmail