Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the Email FROM Name with NodeJs aws-sdk

I am sending Emails via the aws-sdk for Nodejs like this:

const params = {
    Destination: {
        ToAddresses: [... ],
    },
    Message: {
        Body: {
            Html: {
                Data: `...`,
                Charset: 'utf-8'
            },
        },
        Subject: {
            Data: `...`,
            Charset: 'utf-8'
        }
    },
    Source: '[email protected]',
    ReturnPath: '[email protected]',
};
awsConfig.ses.sendEmail(params, (err, data))

The received email looks like this in Gmail: received email

However, I want to know how to change this name:

Currently the from name is support, because the from email is [email protected]. But I want it to be replaced by the company like GitHub below.

Thanks in advance for any help!

like image 953
Flo Avatar asked Nov 25 '18 09:11

Flo


1 Answers

Here is what I ended up doing: I set the Source attribute in the params to

'CompanyName <[email protected]>'

Thanks to @Neil Lunn

like image 89
Flo Avatar answered Oct 16 '22 20:10

Flo