Skip to content
Advertisement

AWS SES Email not verified with Laravel

I have this mail test class to send email to user by SES:

class Test extends Mailable
{
    use Queueable, SerializesModels;

    public function build()
    {
        return $this->markdown('admin.emails.email-user2');
    }
}

by tinker:

 Mail::to('myemail@gmail.com')->send(new AppMailAdminTest());

Even I opened case and convert from sandbox to production:

enter code here

My .env:

MAIL_MAILER=ses
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=null
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=test@gmail.com
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=AK###IAV66#########
AWS_SECRET_ACCESS_KEY=P+G0x21#######ZJklHhRZbh#####kMu
AWS_DEFAULT_REGION=us-east-2
AWS_BUCKET=

Am I missing something?

The error::

    Aws/Ses/Exception/SesException with message 'Error executing "SendRawEmail" on "https://email.us-east-2.amazonaws.com"; AWS HTTP error: Client error: `POST https://email.us-east-2.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-2: ASU <asu@gmail.com>, asu@gmail.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-2: ASU &lt;asu@gmail.com&gt;, asu@gmail.com</Message>
</Error>
<RequestId>8547280e-b97d-410c-b278-7d10626495b2</RequestId>
</ErrorResponse>

Advertisement

Answer

Moving from Sandbox to Production only eliminates the requirement to verify the recipient addresses , however, you must need to verify a From/Envelope-Sender/Return Path address.

This is to make sure that you don’t use someone else’s email and spam the recipients and misuse of a email service. If it’s gmail etc, you need to verify email address, if you plan to use your own domain, you can just verify the domain and show Amazon the ownership of the domain and you no longer need to verify email@your_domain.com

Verify a Domain

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement