php - Laravel won't send anymore mails after testing my job class on prouction using "QUEUE_DRIVER=sync"
问题描述
At first, it sends some emails then stopped without giving any errors, I tested tinker and it gives "null" without receiving anything!!
this is my config
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=haith*****@gmail.com
MAIL_PASSWORD=******
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=haith*****@gmail.com
MAIL_FROM_NAME=Mar****
解决方案
使用同步驱动程序,您实际上没有队列,因为排队的作业会立即运行。这对于本地或测试目的很有用,但显然不推荐用于生产,因为它消除了设置队列带来的性能优势。尝试交换到数据库驱动程序
QUEUE_DRIVER=database
php artisan queue:table
php artisan migrate
推荐阅读
- excel - Excel Sigma 求和 - 二次表达式
- php - Wordpress 帖子页面 - 循环未显示最新帖子
- algorithm - 按索引映射的函数是否有通用名称?
- python - 如何遍历列表列表,找到相同索引位置的值?
- php - 从字符串中删除除日期之外的所有数字
- android - android Binder调用中的SecurityException到不正确的接口
- c# - EF 使用具有复合键的一对多模型
- java - 通过另一个 List 扩展 ImmutableList.of()
- twitter-bootstrap - 如何在用户图像灰色背景或褪色背景上显示复选框?
- python - 如何从 Django Rest Framework 中的端点导出 PDF