1

I try to send mail via Laravel with amazon SES from custom sender addresses. When I try to send it, I have this error:

exception 'Aws\Ses\Exception\SesException' with message 'Error executing "SendRawEmail" on "https://email.us-east-1.amazonaws.com"; AWS HTTP error: Client error: POST https://email.us-east-1.amazonaws.com resulted in a 400 Bad Request response:

<ErrorResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/"> <Error> <Type>Sender</Type> <Code>MessageReje (truncated...) MessageRejected (client): Email address is not verified. The following identities failed the check in region US-EAST-1: =?utf-8?Q?Rapha=C3=ABl?= XXXXX <XXXXX@XXXXX.com>, XXXXX@XXXXX.com - <ErrorResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/"> <Error> <Type>Sender</Type> <Code>MessageRejected</Code> <Message>Email address is not verified. The following identities failed the check in region US-EAST-1: =?utf-8?Q?Rapha=C3=ABl?= XXXXX <raphaelht@gmail.com>, XXXXX@XXXXX.com</Message> </Error> <RequestId>ee2403e6-07d7-11e7-83bf-69ca6c084a61 </ErrorResponse>

So it seems my sender mail address is not accepted. In other hand, one application built with Zend Framework (I did not built it) with the same Amazon account works for same sender address.

I think there is something to do to accept "random" sender addresses (it works for the Zend one). In the configuration of the Zend application, there is one more information for SES:

'arn' => array(
    'emails' => 'arn:aws:sns:us-east-1:xxxxxxxxx:Emails'
),

Is this this line which make it work? How can I do the same thing with Laravel?

rap-2-h
  • 30,204
  • 37
  • 167
  • 263

2 Answers2

1

You can only send emails after verifying the email address (the email in the FROM field). This is an anti spam / anti phishing measure.

http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html

Mircea Soaica
  • 2,829
  • 1
  • 14
  • 25
  • It seem it's not the case. The other application send mail from random users for 4 years now. I can send you one if you want :) – rap-2-h Mar 13 '17 at 11:01
  • check the answers here: http://stackoverflow.com/questions/22128800/amazon-ses-email-address-is-not-verified – Mircea Soaica Mar 13 '17 at 11:03
  • The error you get stated that the Email address is not verified so you have to follow the steps in the documentation in order to get production access. – Mircea Soaica Mar 13 '17 at 11:05
  • Oops. I did not see the previous application uses only "reply to" and sets the user name in "from". So it seemed really like it sets the sender mail. Thank you for your time, sorry about my question. – rap-2-h Mar 13 '17 at 11:16
1

If you are having restrictions making you to send mail to only verified email addresses and domains, or to the Amazon SES mailbox simulator.

Than you are in a SES Sandbox.

You need your account be removed from the Amazon SES sandbox

read more here

https://docs.aws.amazon.com/ses/latest/DeveloperGuide/request-production-access.html

Yevgeniy Afanasyev
  • 37,872
  • 26
  • 173
  • 191