Laravel Mail::send() sending to multiple to or bcc addresses

前端 未结 10 1224
梦谈多话
梦谈多话 2020-11-28 05:26

I can\'t seem to successfully send to multiple addresses when using Laravel\'s Mail::send() callback, the code does however work when I only sp

10条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-28 06:27

    In a scenario where you intend to push a single email to different recipients at one instance (i.e CC multiple email addresses), the solution below works fine with Laravel 5.4 and above.

    Mail::to('dunsin.olubobokun@domain.com')
        ->cc(['paul.yomi@domain.com','stack.overflow@domain.com','abc.xyz@domain.com','nigeria@domain.com'])
        ->send(new document());
    

    where document is any class that further customizes your email.

提交回复
热议问题