第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

Laravel 使用 mail::to 發(fā)送電子郵件而不查看其他收件人

Laravel 使用 mail::to 發(fā)送電子郵件而不查看其他收件人

PHP
慕容3067478 2022-07-16 16:00:27
我有一組收件人$this->recipients,我想向所有收件人發(fā)送電子郵件而不顯示彼此的電子郵件。目前,它顯示電子郵件中的所有收件人。 if (count($this->recipients) > 1) {                Mail::bcc($this->recipients)                    ->send(new EmailNotificationMailable($this->notificationRequest));            } else {                Mail::to($this->recipients)                    ->send(new EmailNotificationMailable($this->notificationRequest));            }我試過(guò)這段代碼,但是當(dāng)我用Mail::bcc電子郵件發(fā)送時(shí)To是空的。請(qǐng)為此提供有效的解決方案。我不想循環(huán)收件人數(shù)組
查看完整描述

2 回答

?
阿晨1998

TA貢獻(xiàn)2037條經(jīng)驗(yàn) 獲得超6個(gè)贊

您需要遍歷收件人集合:


if(count($this->recipients) > 1)

{

 $this->recipients->each(function($recipient)

 {

    Mail::to(recipient)->bcc($this->recipients)->send(new EmailNotificationMailable($this->notificationRequest));

 }

}else{

    Mail::to($this->recipients)->send(new EmailNotificationMailable($this->notificationRequest));

}


查看完整回答
反對(duì) 回復(fù) 2022-07-16
?
GCT1015

TA貢獻(xiàn)1827條經(jīng)驗(yàn) 獲得超4個(gè)贊

使用這樣的東西:

Mail::to(array_pop($this->recipients))->bcc($this->recipients)

這會(huì)將recipients數(shù)組中的最后一個(gè)條目設(shè)置為郵件接收者,并且所有其他地址都將通過(guò)密件抄送包括在內(nèi)。


查看完整回答
反對(duì) 回復(fù) 2022-07-16
  • 2 回答
  • 0 關(guān)注
  • 276 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)