Support the ongoing development of Laravel.io →
Mail Laravel

Hello everybody, I'm having a little bit of an issue here, but I'm not entirely sure if this has something to do with Docker...

I'm running a dockerized laravel application inside an AWS EC2 server, but every time I try to call the Mail function, I'm getting this error:

exception: "Swift_TransportException"
file: "/var/www/api/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php"
line: 457
message: "Expected response code 250 but got code "530", with message "530 5.7.1 Authentication required↵""

Everything works perfectly on localhost, using the same dockerized application and running it with docker-compose as in my EC2 ubuntu instance (i'm using mailtrap).

So... Do I need to install or configure something inside my docker container like ssmtp or anything related to php/smtp itself?

FYI .env is configured properly.

Thanks in advance.

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

Joel de Leon deleonn Joined 31 Oct 2018

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.