Adsense
Popular Posts
- Install APXS in Redhat Linux
- MySQL workbench -"Could not decrypt password cache"
- Transfer modules between sites
- JavaScript, remove trailing insignificant zeros after toFixed function
- Set Windows path command line
- datatable order by nunmeric
- MySQL date created and date modified
- super(props) in React
- PHP, dump varailbes in a format way
- React: connect(mapStateToProps, mapDispatchToProps)
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