【问题标题】:How to add name in email headers using aws ses如何使用 aws ses 在电子邮件标题中添加名称
【发布时间】:2017-01-05 01:57:04
【问题描述】:

下面是我使用 nodejs 使用 aws ses 发送电子邮件的代码。

ses.sendEmail( { 
           Source: sails.config.myconf.aws.emailFrom, 
           Destination: { ToAddresses: [useObj.email]},
           Message: {
               Subject:{
                  Data: subject
               },
               Body: {
                   Html: {
                       Data: template,
                   }
                }
           }
        }); 

它会起作用,见下面的附图 但它显示联系人为姓名。而不是这个,我想在那里添加客户名称。

【问题讨论】:

  • 我已经检查了这个链接并尝试了接受的答案,但它不起作用。
  • 你需要具体解释一下“它不起作用”是什么意思。参考答案中的解决方案是正确的——您将发送地址设置为"Sender Name" <address@example.com> 之类的字符串。如果这不起作用,请解释它是如何失败的。
  • 来源:'John Doe ',我尝试使用它,但它给出了错误

标签: node.js amazon-web-services amazon-ses


【解决方案1】:

你可以试试sails.config.myconf.aws.emailFrom 像

Sachin Sharma < sachin@enraiser.com >

reference 1

【讨论】:

  • 我试过 MailFromDomain: 'clientName',它不起作用。它说在参数中找到了意外的密钥“MailFromDomain”。您知道要使用的确切密钥吗?
【解决方案2】:
Source: '"ABC Group" <'+sails.config.myconf.aws.emailFrom+'>';

以上代码解决了我的问题。

【讨论】:

  • 还告诉我,它与我的提议有何不同。从逻辑上讲,我提出了同样的建议。在这里和那里缺少报价并没有使它成为不同的答案。而不是发布新答案,您应该更正我的答案。
【解决方案3】:

您可以设置名称为来源(来源:“应用名称!!app_email@example.com”)。下面的例子

{
    Destination: {
        ToAddresses: ["example@example.com"]
    },
    Message: {
        Body: {
            Html: {
                Data: "YOUR MESSAGE"
            }
        },
        Subject: {
            Data: "YOUR SUBJECT"
        }
    },
    Source: "App Name!! <from_email@example.com>"
} 

https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/ses-examples-sending-email.html

【讨论】:

    猜你喜欢
    • 2021-10-07
    • 2020-10-04
    • 2015-03-29
    • 2020-09-16
    • 1970-01-01
    • 2011-08-07
    • 2020-10-20
    • 2017-11-11
    • 1970-01-01
    相关资源
    最近更新 更多