从 AWS SES Javascript v3 SDK 发送电子邮件时是否可以包含显示名称?
Can I include a display name when sending email from the AWS SES Javascript v3 SDK?
我想发送一封包含显示名称的发件人(来源)地址的电子邮件,如下所示:
const command = new Ses.SendEmailCommand({
Destination: {
ToAddresses: [ 'some-recipient@test.com' ],
},
Source: 'John Doe <jdoe@test.com>',
Message: {
Subject: {
Data: 'some subject',
},
Body: {
Html: {
Data: 'some html message',
}
}
}
})
const response = await this.client.send(command)
但是,此操作失败并返回“MessageRejected”响应。如果我只用“jdoe@test.com”替换源,那么它工作正常。如何包含显示名称?
请注意,我也尝试了 "John Doe" <jdoe@test.com>
,结果相同。
也许试试这个:
"John Doe" <johndoe@example.com>
文档:http://docs.aws.amazon.com/ses/latest/DeveloperGuide/email-format.html
确实支持这个。错误出在消息属性的其他地方。作为记录,正确的格式是 John Doe <jdoe@test.com>
,显示名称两边没有引号。
我想发送一封包含显示名称的发件人(来源)地址的电子邮件,如下所示:
const command = new Ses.SendEmailCommand({
Destination: {
ToAddresses: [ 'some-recipient@test.com' ],
},
Source: 'John Doe <jdoe@test.com>',
Message: {
Subject: {
Data: 'some subject',
},
Body: {
Html: {
Data: 'some html message',
}
}
}
})
const response = await this.client.send(command)
但是,此操作失败并返回“MessageRejected”响应。如果我只用“jdoe@test.com”替换源,那么它工作正常。如何包含显示名称?
请注意,我也尝试了 "John Doe" <jdoe@test.com>
,结果相同。
也许试试这个:
"John Doe" <johndoe@example.com>
文档:http://docs.aws.amazon.com/ses/latest/DeveloperGuide/email-format.html
确实支持这个。错误出在消息属性的其他地方。作为记录,正确的格式是 John Doe <jdoe@test.com>
,显示名称两边没有引号。