Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return value of HyperfExt\\Mail\\PendingMail::send() must be of the type array, bool returned #3

Open
Adian-1012 opened this issue Jun 3, 2021 · 3 comments

Comments

@Adian-1012
Copy link

Adian-1012 commented Jun 3, 2021

配置使用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

image

@sanye4639
Copy link

目前我用queue异步队列发送成功

@Linnzh
Copy link

Linnzh commented Oct 4, 2021

这好像是因为gen:mail生成的 Mail 类默认实现了ShouldQueue接口,导致send()方法会转到queue()方法(该方法返回 bool 值)。

图片

去掉该接口的实现就行。

@Luoyang-MrZhang
Copy link

这个需要修复的吧,本身send方法是会根据类决定调用 queue 还是 send

PendingMail 的send方法限制了返回类型array 但是 queue 方法放回的类型是 bool

我觉得要不兼职send对两个返回类型的支持,要不取消send对queue方法的支持

这样会减少很多误解

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants