vendredi 23 mars 2018

Why is Laravel using a different mail driver for queued e-mails?

In development mode, I was using mailtrap to test e-mails. Bulk e-mails were working fine too with queues. When I moved my application to production mode, I was unable to send bulk e-mails using the queue.

When I tried to use my production mail driver SparkPost in development mode to check if something is wrong with e-mails, I found that I was able to send e-mails directly. E-mails like password resets were working fine. But when I tried to send bulk e-mails, I was receiving e-mails in the Mailtrap inbox. I cleared the cache using php artisan cache:clear but I am still getting e-mails in the Mailtrap inbox while I am using SparkPost credentials in my .env file and also mail.php file.

Here is my .env file:

MAIL_DRIVER=smtp
MAIL_HOST=smtp.sparkpostmail.com
MAIL_PORT=587
MAIL_USERNAME=SMTP_Injection
MAIL_PASSWORD=MY_SECRET_LITTLE_KEY

The only mention of smtp.mailtrap.io is in .env.example file. I looked for this host recursively in my whole directory.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire