mail
mail copied to clipboard
Return value of HyperfExt\\Mail\\PendingMail::send() must be of the type array, bool returned
配置使用smtp的ssl加密出现这个报错
用demo中的发送方式会报错 Mail::to($request->user())->send(new OrderShipped($order));
Return value of HyperfExt\\Mail\\PendingMail::send() must be of the type array, bool returned[149] in /var/www/fly2-intl-api/vendor/hyperf-ext/mail/src/PendingMail.php

目前我用queue异步队列发送成功
这好像是因为gen:mail生成的 Mail 类默认实现了ShouldQueue接口,导致send()方法会转到queue()方法(该方法返回 bool 值)。

去掉该接口的实现就行。
这个需要修复的吧,本身send方法是会根据类决定调用 queue 还是 send
PendingMail 的send方法限制了返回类型array 但是 queue 方法放回的类型是 bool
我觉得要不兼职send对两个返回类型的支持,要不取消send对queue方法的支持
这样会减少很多误解