发送带有CSV附件的电子邮件

时间:2020-09-07 20:53:49

标签: laravel-5

我尝试使用 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));

失败,错误是:

enter image description here

如果我评论电子邮件中的附加行,则Mail :: queue可以正常工作,但我需要在后台发送电子邮件

0 个答案:

没有答案