Using Email Body and Attachment at a time
My Code is:
Mail::send( [],array(), function ($message) use ($fromName,$fromEmail,$receiptEmailSubject,$receiptEmailData,$emilId,$pdf){
$message->to($emilId)
->from($fromEmail,$fromName)
->subject($receiptEmailSubject)
->setBody($receiptEmailData, 'text/html')
->attachData($pdf->output(), 'receipt.pdf',['mime' => 'application/pdf']);
});
But unable to use "setBody" and "attachData" as like. (If removed any one email sending works Properly. Need to remove "setBody" OR "attachData")
How to use "setBody" and "attachData" together ?