25

I'm using aws-sdk-for-php and using AmazonSES for sending email. The problem is I want to set the name for the email. Example:

指定 < email_address >

Here my source code:

$mailer = new \AmazonSES( $aws_config ); $response = $mailer->send_email($mail_data['from'],$mail_data['to']);
yivi
  • 23,845
  • 12
  • 64
  • 89
Mr.Coi
  • 277
  • 1
  • 3
  • 6

3 Answers3

64

I believe the format you're looking for is as follows:

"John Doe" <johndoe@example.com>

Reference: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/email-format.html

dezinezync
  • 2,364
  • 18
  • 14
  • 1
    Yes, thanks you. But I have another problem if name is not English character. How can I use with name such as 指定 – Mr.Coi Mar 03 '14 at 07:45
  • So turns out, by default, only ASCII characters are allowed for that. So the Chinese string wouldn't work. Although, it does sound possible using the RFC 2047 Encoding as mentioned in here: http://docs.aws.amazon.com/ses/latest/APIReference/API_Destination.html – dezinezync Mar 03 '14 at 08:15
  • Did you ever find out how to change the encoding ? – Sahan Jul 11 '16 at 08:32
  • @Sahan you cannot change the encoding. Maybe because how email systems are configured and written, ASCII is the only one supported. – dezinezync Jul 11 '16 at 09:05
1

I have resolved the same issue after checking this aws forum link . I was using aws SES for sending mails using java sdk , so I have added the from email id in the application.yml file like below.

from: John Doe <johndoe@example.com>
Vignesh_A
  • 410
  • 4
  • 16
-1

I only changed the format and it is working fine for me.

"from": {
   "name": "name",
   "address": "email address"
}
Cray
  • 2,347
  • 7
  • 17
  • 27