Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use Amazon's SES to send a display name with the source email address?

I've got some .Net code I'm switching from the System.Net.MailMessage to Amazon SES and their .Net SDK v2. Is it possible to include a display name with SES using the SDK similar to the MailMessage object?

The relevant part of the old code looks something like this:

    MailMessage message = new MailMessage();
    MailAddress toAddress = new MailAddress(_user.Email, _user.DisplayName);
    message.To.Add(toAddress);

The relevant part of the new code (so far):

        SendEmailRequest request = new SendEmailRequest()
        {
            Source = _user.Email
        };
like image 206
Jake Braun Avatar asked Jan 24 '14 15:01

Jake Braun


People also ask

Can AWS create email id?

To create an email address identity (console)Sign in to the AWS Management Console and open the Amazon SES console at https://console.aws.amazon.com/ses/ . In the navigation pane, under Configuration, choose Verified identities. Choose Create identity.

Which of the following methods through which Amazon SES delivers mail?

Amazon SES supports two methods of authentication: Sender Policy Framework (SPF) and DomainKeys Identified Mail (DKIM).

Which AWS service can be used to send emails?

Amazon Simple Email Service (SES) is a cost-effective email service built on the reliable and scalable infrastructure that Amazon.com developed to serve its own customer base. With Amazon SES, you can send transactional email, marketing messages, or any other type of high-quality content to your customers.

Can I configure SES with my own domain?

You can configure a MAIL FROM domain for an entire domain. When you do, all of the messages that you send from addresses on that domain use the same MAIL FROM domain. Open the Amazon SES console at https://console.aws.amazon.com/ses/ . In the left navigation pane, under Configuration, choose Verified identities.


2 Answers

You can set this in your App Settings or WebConfig and concatenate the name and email in your method like this:

var toAddress = $"{_configuration["AWS-SES:SenderName"]} <{_configuration["AWS-SES:SenderAddress"]}>";

its found for .NET

like image 81
Mathías Padula Avatar answered Sep 20 '22 13:09

Mathías Padula


With the Java SDK you can include the display name in the sender field using the format:

John Doe <[email protected]>

I assume it is the same with the .NET SDK.

like image 33
David Levesque Avatar answered Sep 18 '22 13:09

David Levesque