Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Hayanno's avatar

Sending mail from EC2 (from Beanstalk) not working when I add route53 elastic IP to my Beanstalk

Hello guys,

I've been loosing my whole work day figuring this out and it's driving me crazy.

So I have a Laravel 8 application hosted on EC2, configured from Beanstalk.

Everything was working fine, but when I added a domain name to my Beanstalk from Route53, my emails stopped working. I tried everything but nothing seems to work. I also got no error and everything on Laravel side tell me that email is sent.

Here's my .env :

MAIL_MAILER=smtp
MAIL_HOST=ssl0.ovh.net
MAIL_PORT=587
MAIL_USERNAME=****@****.fr
MAIL_PASSWORD=*******
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=noreply@******.fr

I don't think it's coming from my .env since I didn't change anything in my configuration, also IT'S WORKING ON LOCALHOST.

I tried to use SES but it's a bit complicated for now, I'd like not to take this road.

Thank you for reading and trying to help.

Edit : When I say stopped working, I mean that I do not receive any email now, I tried multiple mail adresses, from multiple hosting provider (custom, gmail, etc...).

In Route53 I just pointed my domain name to my elastic beanstalk instance.

I have no specific error, that's what's driving me crazy, I checked laravel.log and also my http request is 200, no error nowhere to be found, but I still don't receive any emails.

0 likes
1 reply
Brian Kidd's avatar

Does your smtp provider require that you whitelist domains that can send emails? Strange that by just doing that, it caused a problem. I used SES all of the time so if you need help with that, I can do it. First step is making sure your AWS IAM user has authorization to SES and then follow the Laravel email configuration setup for SES. I usually se SES API rather than configuring using SMTP but SES allows both, I think.

Please or to participate in this conversation.