你好,我嘗試從一個命令一個excel文件發送一封電子郵件,但它似乎不起作用郵件梅索德
我得到這個例外,當我嘗試運行工匠命令:
調用未定義的方法照亮\郵件\ PendingMail ::主題()
現在有人如何解決這個問題呢?感謝很多提前
這裏我的命令:
public function handle()
{
$user = Auth::user();
$licencies = Licencies::where('lb_assurance' , '=' , 'Lafont')
->where('created_at' , Carbon::today())->get();
$excel_file = Excel::create('DailyRecapLicencesLafont',
function($excel) use ($licencies) {
$excel->sheet('Excel', function($sheet) use ($licencies) {
$sheet->fromArray($licencies);
});
});
Mail::to($user)
->subject('Licences Lafont Daily')
->from('[email protected]')
->attach($excel_file , 'LaFontDaily.xls')
->send();
$this->info('Lafont task Done');
}
哪個laravel版本? – dparoli
我使用L 5.4! –
您的郵件門面的使用不正確,請檢查文檔發送電子郵件原料:https://laravel.com/docs/5.1/mail#sending-mail – dparoli