(AWS SES / Laravel) - Connection Could Not Be Established With Host Smtp.mailtrap.io
I've been trying to setup mailing in Laravel 7 with AWS SES and have setup all my credentials properly and set my drivers to SES.
I get the following error when attempting to send an email verification with the default built in functionality.
Connection could not be established with host smtp.mailtrap.io :stream_socket_client(): unable to connect to tcp://smtp.mailtrap.io:2465 (Operation timed out)
.env
MAIL_DRIVER=ses
[email protected]
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=HIDDEN
AWS_SECRET_ACCESS_KEY=HIDDEN
AWS_DEFAULT_REGION=us-east-1
I have ensured that the AWS key and secret have full access to SES, in my config/services.php
I am setting it to use these credentials.
'ses' => [
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
]
I have searched through numerous "solutions" and have tried creating a separate user for SES only with no luck.
Any help would be great, thanks!
Answer
The issue was that my .env
was not being loaded due to caching.
Simply running php artisan config:clear
cleared the cached config and updated it with my new parameters.
My .env
contains the following:
MAIL_MAILER=ses
[email protected]
MAIL_FROM_NAME="${APP_NAME}"
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS - Conditionally Load a Different Page
- → Make a Laravel collection into angular array (octobercms)
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?
- → Validating fileupload(image Dimensions) in Backend Octobercms
- → OctoberCMS Fileupload completely destroys my backend
- → How do I call the value from another backed page form and use it on a component in OctoberCms