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

问题描述 投票:0回答:1

我使用nodemailer发送电子邮件,但是我需要定义Return-Path。

我在地址fromreplyToreturnPath中定义。

ReturnPath(Return-Path)的写法是这样的:<[email protected]>

但是它不起作用。它总是更改电子邮件服务器地址上消息源代码中的Return-Path。有任何想法吗?谢谢。

nodemailer return-path
1个回答
0
投票

尝试使用信封属性

const mailOptions = {
    envelope: {
      'from': '<[email protected]>',
      'to': "[email protected]"
    },
    from: "Info <[email protected]>",
    to: "[email protected]",
    subject: "....",
    text: "Hello world",
    html: "<b>Hello world ✔</b>",
}

sendMail(mailOptions);

不要省略“ <>”

© www.soinside.com 2019 - 2024. All rights reserved.