Email Setup

This time I have a more substantial and complicated question.
We have set up AWS SES to use as SMTP provider.
In the AWS console we have:

Verified identities using the same email as the PhPVMS install.
Verified Domain.
Created SMTP user with credentials. 
Removed the sandbox and went into production.
We went through all the AWS configuration steps properly and sent test emails from within the console successfully.

The PhPVMS config states that to use SES, this is what is needed:

 

SES Configuration

To use SES, set your .env like:

 

MAIL_MAILER=postmark
AWS_ACCESS_KEY_ID=‘key id’
AWS_SECRET_ACCESS_KEY=‘access key’
AWS_DEFAULT_REGION=‘the region if not us-east-1’ (We are currently in region us-east-2)

We set it up exactly like the above with our valid & active Access Key & Secret Access Key.

When we try to send an email PhPVMS throws a 500 internal error which points to misconfiguration or missing parameters in the .env file
The LOG also shows a configuration issue.

Are we missing some parameters in the .ENV file that aren’t stated in the docs?
What am I failing to understand?

Thanks in advance as always!

Screenshot2025-02-24010704.png.9313b762f0bb8cecacb0a7d65723dea3.png

Hi

 

I don’t think that _MAIL\_MAILER=postmark_ is right.

 

Did you tried MAIL_MAILER=ses  there by any chance ? Don’t forget to clear application cache for .env changes to be applied.

 

Good luck

Yes, tried SES, but no dice.
Somehow, I think the configuration is missing some details.
Maybe Nabeel can pitch in when he has a moment…

What is the error after changing mailer to “ses” ? It should be something different compared to using postmark driver. If you’ve shared your logs with Nabeel it is ok, if not how he can help ?

 

I checked phpvms config for ses, it looks ok though.

So… To bring some closure to this topic in case anyone needs it one day, these are the changes we went through to make the mail work:

.env file setup as in the picture attached
services.php modified as in the picture attached
mail.php modified as in the picture attached

That makes it work with Amazon SES flawlessly. 
Thank God for the phpvms community and AI 🙃

Screenshot2025-03-02170404.png.a84d9452477db5e3613b3429a2e34a6f.png

Screenshot2025-03-02170347.png.9835ab80050718145533d533b4bb9b62.png

Screenshot2025-03-02170150.png.95711b1af85f350a8850d907de7bddc9.png

Hi

 

Looks like you added " SES_ENDPOINT" only to services

 

https://github.com/phpvms/phpvms/blob/main/config/services.php#L26-L30

 

Technically the " MAIL_FROM_ADDRESS" and " MAIL_FROM_NAME" are already defined and can be controlled from .env itself, no need to modify mail.php  for them, as it will revert back to defaults during an update.

 

We can add that additional AWS SES Enpoint to phpVMS itself, so future updates will have it and you will not worry about updates

 

Safe flights

1 Like