如何使用nodejs nodemailer定义返回路径?



我使用nodemailer发送电子邮件,但我需要定义返回路径。

我在地址from中定义,replyToreturnPath

returnPath(Return-Path(是这样写的:<bla@somewhere.com>

但它不起作用。它始终更改电子邮件服务器地址上邮件源代码中的Return-Path。有什么想法吗?谢谢。

尝试使用信封属性

const mailOptions = {
envelope: {
'from': '<your@return-path.com>',
'to': "detination@email.com"
},
from: "Info <foo@example.com>",
to: "detination@email.com",
subject: "....",
text: "Hello world",
html: "<b>Hello world ✔</b>",
}
sendMail(mailOptions);

不要省略"<>">

最新更新