欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

laravel mail send multiple cc 邮件 抄送 发送多人 群发 5.2 里面好像不能传数组, 好像5.3以上的可以 有大用


image.png

正确答案

$emails = ['myoneemail@esomething.com', 'myother@esomething.com','myother2@esomething.com'];

Mail::send('emails.welcome', [], function($message) use ($emails)
{    
    $message->to($emails)->subject('This is test e-mail');    
});
var_dump( Mail:: failures());
exit;



来自  https://stackoverflow.com/questions/26584904/laravel-mailsend-sending-to-multiple-to-or-bcc-addresses


正确答案

Mail::to($email)
    ->cc(['name1@domain.com','name2@domain.com'])
    ->send(new document());



来自  

https://stackoverflow.com/questions/43762735/sending-email-to-multiple-cc-recipients-in-laravel-5-4?rq=1



正确答案


Mail::send('mail', array('key' => $todos1), function($message) {
$message->to('Hello@example.com')
->bcc(array('TEST@example.com','TEST1@example.com','TEST2@example.com','TEST3@example.com'))
->subject('Welcome!');



来自  

https://stackoverflow.com/questions/40842041/laravel-send-mail-to-multiple-recipients-with-the-name-of-recipient





$this cc(string|array $address, string|null $name = null)    

Add a carbon copy to the message.

Parameters

string|array$address
string|null$name

Return Value

$this

at line 107        
$this bcc(string|array $address, string|null $name = null)    


   

来自  https://laravel.com/api/5.3/Illuminate/Mail/Message.html#method_to    

普通分类: