I am using:
The problem:
I am trying to setup the password reset system for my application. The problem is that Fortify automatically sends the password reset email using the user's email address (ie: if the user with email test@example.com tries to reset the password, Laravel will try to send an email from test@example.com).
Because of how Amazon SES works, you can only send email from verified idetities. I have my email address (info@openlabvr.com) verified on SES, and I can send regular emails in Laravel just by specifing ->from()
. Everything works fine here.
But of course, when Laravel tries to send the reset password email using the user's email adddress, I get an error from SES:
<Code>MessageReje (truncated...) MessageRejected (client): Email address is not verified. The following identities failed the check in region US-WEST-1: test@example.com - <ErrorResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/"> <Error> <Type>Sender</Type> <Code>
What I have tried:
I tried to set MAIL_FROM_ADDRESS="info@openlabvr.com"
in my .env
file, and to run php artisan config:clear
and/or php artisan optimize
, but nothing changed.
I also tried to set the Source
option in the services.php
file like so:
'ses' => [
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'options' => [
'Source' => 'info@openlabvr.com',
],
],
But again, nothing changed.
Lastly, I tried to to change my user's email address from test@example.com to info@openlabvr.com, and that worked as expected.
tldr
How can I force Fortify to use info@openlabvr.com as the sender address to reset the password of my user?
Solved.
The problem was with AWS SES and not actually with Fortify Under verified identities, on the SES console, it says:
A verified identity is a domain, subdomain, or email address you use to send email through Amazon SES
In reality, this is not true. You also need to verify the identity of the receiver's email address. Therefore, the only solution for my problem is to apply for a production SES account, rather than the sandbox one I had.