Skip to content

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

Open

Description

@Adian-1012

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

Activity

  1. sanye4639 commented on Jun 29, 2021

    @sanye4639

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

  2. Linnzh commented on Oct 4, 2021

    @Linnzh

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

    图片

    去掉该接口的实现就行。

  3. Luoyang-MrZhang commented on Nov 23, 2021

    @Luoyang-MrZhang

    这个需要修复的吧,本身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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions