Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon SES display sender name using PHP?

I've been following this guide to send emails using Amazon SES: http://www.codeproject.com/Articles/786596/How-to-Use-Amazon-SES-to-Send-Email-from-PHP

This worked fine and I was able to send emails. What I want is to also be able to display the name of the sender instead of just the email address when the receiver gets the email.

What I currently have now is:

$msg = array();
$msg['Source'] = "[email protected]";

How can I also add a name to this? I was previously using swiftmailer and this worked with "[email protected]' => 'My Name'". This, however, doesn't work with amazon SES, at least not in my script.

like image 761
Damien Avatar asked Oct 09 '15 16:10

Damien


People also ask

How send email from AWS SES in PHP?

$host = ' email-smtp.us-west-2.amazonaws.com '; $port = 587; // The subject line of the email $subject = 'Amazon SES test (SMTP interface accessed using PHP)'; // The plain-text body of the email $bodyText = "Email Test\r\nThis email was sent through the Amazon SES SMTP interface using the PHPMailer class."; // The ...

How can I find out which IAM user sent an email through Amazon SES?

On the All metrics tab, choose SES. Choose the dimension name that you entered when you created the configuration set. For example, choose ses:caller-identity. Under the ses:caller-identity column, you'll see the IAM user who sent the test email.

How do I get my SMTP username and password for AWS?

From the navigation pane, under Email Sending, choose SMTP Settings. Choose Create My SMTP Credentials. For IAM User Name, you can accept the default name, or enter a new name. Choose Create.


1 Answers

I figured it out. If anyone has the same issue just format it like in the example below:

$msg['Source'] = "My Name <[email protected]>";
like image 60
Damien Avatar answered Sep 22 '22 01:09

Damien