with(['account'])->first(); $pdfPath = storage_path().'/pdfcache/cache-'.$invoice->id.'.pdf'; if($invoice->account->pdf_email_attachment && file_exists($pdfPath)) { $message->attach( $pdfPath, array('as' => $invoice->getFileName(), 'mime' => 'application/pdf') ); } } //$message->setEncoder(\Swift_Encoding::get8BitEncoding()); $message->to($toEmail)->from($fromEmail, $fromName)->replyTo($replyEmail, $fromName)->subject($subject); }); } }