我尝试使用 Mail :: queue 而不是 Mail :: send
发送电子邮件时遇到问题我使用League \ Csv \ Writer生成CSV:
$csv = $this->csvGenerator->generate(array_merge($translatedLead, $translatedProperty));
然后我发送:
Mail :: send(new LeadSubmittedEmail($ lead,$ csv,$ this-> everhomeRecipients,$ token));
我收到的内部电子邮件:
return $this->from($this->listingNoReply)
->subject("Everhome App Listing Request #{$this->lead->id}")
->attachData($this->csv, 'lead.csv', ['mime' => 'text/csv'])
->to($this->recipients)
->view('emails.withSellerLead.leadSubmitted');
这可以正常工作,但是如果将Mail :: send更改为Mail :: queue:
Mail::queue(new LeadSubmittedEmail($lead, $csv, $this->everhomeRecipients, $token));
失败,错误是:
如果我评论电子邮件中的附加行,则Mail :: queue可以正常工作,但我需要在后台发送电子邮件