Adsense
Popular Posts
- Code update from PHP 7.4 to PHP 8.1 - PhpSpreadsheet
- MySQL workbench -"Could not decrypt password cache"
- Code update from PHP 7.4 to PHP 8.1 - Worksheet/Iterator.php
- Rendering HTML tags inside textarea
- axios handle blob type data
- Unix Utils and wget in Windows
- increase mysql query speed
- Setup vi syntax for PHP
- Get WAMP running on EC2
- EXCEL return to the next line in the same cell
Tuesday, February 8, 2022
Laravel: Send Email
$data = array(
'userName' => $userName,
'from' => $from,
'to' => $to,
'cc' => $cc,
'bcc' => $bcc,
'subject' => $subject,
'content' => nl2br($content)
);
array_unique($bcc);
Mail::send([], $data, function($message) use($data) {
$message->to($data['to'])->subject($data['subject']);
if($data['cc'] && is_array($data['cc']) && count($data['cc'])>0){
foreach($data['cc'] as $b){
$message->cc($b);
}
}
if($data['bcc'] && is_array($data['bcc']) && count($data['bcc'])>0){
foreach($data['bcc'] as $b){
$message->bcc($b);
}
}
$message->from($data['from'], $data['userName']);
$message->setBody($data['content'],'text/html');
});
Labels:
Laravel
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment