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

ivymasterman's avatar

Can't override laravel vapor ses mail service with smtp

Hello guys have anyone had this issue with laravel vapor where you can't override ses mail service with SMTP?

I have done all of the mail service configurations in the .env file and it looks like this:

MAIL_MAILER=smtp

MAIL_HOST=smtp.server.com

MAIL_PORT=587

MAIL_USERNAME="smtpserverusername"

MAIL_PASSWORD="smtpserverpassword"

MAIL_ENCRYPTION=tls

MAIL_FROM_NAME="My website name"

MAIL_FROM_ADDRESS=myappsystem.com

And when I try to send the mail in the vapor application I get this error: https://i.stack.imgur.com/cxy4e.png

0 likes
2 replies
martinbean's avatar

@ivymasterman From https://docs.vapor.build/1.0/projects/environments.html#mail:

Laravel provides a clean, simple email API. And, by default, Vapor will automatically configure your environment to use Amazon SES as the default mail driver by injecting the proper Laravel environment variables during deployment. Of course, you may change the default mail driver by defining a different value for the MAIL_MAILER environment variable.

So sounds like you’ve either not set the variables properly, or they’re cached with old values.

You’d really be better off just sticking with SES though instead of some random SMTP server. As I’ve said before, there’s absolutely no point in using Vapor if you’re just going to use non-AWS services.

declanmcdonough's avatar

Don't forget to deploy once you change you env variables to take effect.

Please or to participate in this conversation.