Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS-SES: How to set the display name for the sender address

I am using aws-ses for transactional mailing.
And the email address has this format:

noreply@domain_name.com

The problem is that when the users receive their emails, they see that the sender's name is "noreply" but I'd like to change it to something custom and more friendly.

Here's how SES is configured:

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;

Any idea how to solve this?

like image 211
AG_HIHI Avatar asked Sep 13 '25 16:09

AG_HIHI


1 Answers

try to change

Source: "noreply@domain_name.com", // SENDER_ADDRESS

to (edited)

Source: "Friendly Name <noreply@domain_name.com>", // SENDER_ADDRESS

if this it works let me know!

like image 60
euTIMER Avatar answered Sep 15 '25 11:09

euTIMER