AWS-SES:如何设置发件人地址的显示名称
AWS-SES: How to set the display name for the sender address
我正在使用 aws-ses 进行交易邮件。
电子邮件地址格式如下:
noreply@domain_name.com
问题是,当用户收到他们的电子邮件时,他们看到发件人的名字是“noreply”,但我想将其更改为自定义且更友好的名称。
SES 的配置方式如下:
const { SESClient, SendEmailCommand } = require("@aws-sdk/client-ses");
const REGION = "us-west-2"; //e.g. "us-east-1"
// Create SES service object.
const sesClient = new SESClient({ region: REGION });
const prepare_params = (destination_address, subject, html_email_content) => {
// Set the parameters
const params = {
Destination: {
/* required */
CcAddresses: [
/* more items */
],
ToAddresses: [
destination_address, //RECEIVER_ADDRESS
/* more To-email addresses */
],
},
Message: {
/* required */
Body: {
/* required */
Html: {
Charset: "UTF-8",
Data: html_email_content,
},
Text: {
Charset: "UTF-8",
Data: "TEXT_FORMAT_BODY",
},
},
Subject: {
Charset: "UTF-8",
Data: subject,
},
},
Source: "noreply@domain_name.com", // SENDER_ADDRESS
ReplyToAddresses: [
/* more items */
],
};
return params;
};
const sendEmail = async (destination_address, subject, html_email_content) => {
const params = prepare_params(
destination_address,
subject,
html_email_content
);
const data = await sesClient.send(new SendEmailCommand(params));
return data;
};
exports.sendEmail = sendEmail;
知道如何解决这个问题吗?
努力改变
Source: "noreply@domain_name.com", // SENDER_ADDRESS
至(已编辑)
Source: "Friendly Name <noreply@domain_name.com>", // SENDER_ADDRESS
如果有效请告诉我!
我正在使用 aws-ses 进行交易邮件。
电子邮件地址格式如下:
noreply@domain_name.com
问题是,当用户收到他们的电子邮件时,他们看到发件人的名字是“noreply”,但我想将其更改为自定义且更友好的名称。
SES 的配置方式如下:
const { SESClient, SendEmailCommand } = require("@aws-sdk/client-ses");
const REGION = "us-west-2"; //e.g. "us-east-1"
// Create SES service object.
const sesClient = new SESClient({ region: REGION });
const prepare_params = (destination_address, subject, html_email_content) => {
// Set the parameters
const params = {
Destination: {
/* required */
CcAddresses: [
/* more items */
],
ToAddresses: [
destination_address, //RECEIVER_ADDRESS
/* more To-email addresses */
],
},
Message: {
/* required */
Body: {
/* required */
Html: {
Charset: "UTF-8",
Data: html_email_content,
},
Text: {
Charset: "UTF-8",
Data: "TEXT_FORMAT_BODY",
},
},
Subject: {
Charset: "UTF-8",
Data: subject,
},
},
Source: "noreply@domain_name.com", // SENDER_ADDRESS
ReplyToAddresses: [
/* more items */
],
};
return params;
};
const sendEmail = async (destination_address, subject, html_email_content) => {
const params = prepare_params(
destination_address,
subject,
html_email_content
);
const data = await sesClient.send(new SendEmailCommand(params));
return data;
};
exports.sendEmail = sendEmail;
知道如何解决这个问题吗?
努力改变
Source: "noreply@domain_name.com", // SENDER_ADDRESS
至(已编辑)
Source: "Friendly Name <noreply@domain_name.com>", // SENDER_ADDRESS
如果有效请告诉我!