[英]Laravel 8 doesn't send an email notification when notifications are set to job
我正在嘗試通過電子郵件發送通知。 只要我不想在工作中這樣做,一切都很好。 當我向通知類添加implements ShouldQueue
,任務失敗並出現錯誤Swift_TransportException: Cannot send message without a sender address in C: \\ Users \\ (...) \\ vendor \\ swiftmailer \\ swiftmailer \\ lib \\ classes \\ Swift \\ Transport \\ AbstractSmtpTransport.php: 195
當然env
,config (mail.from.address) 看到你需要什么,當我不嘗試使用工作時,這通過正常郵件和通知確認。
默認通知.php
public function toMail($notifiable)
{
return (new MailMessage)
->line('The introduction to the notification.')
->action('Notification Action', url('/'))
->line('Thank you for using our application!');
}
我試過 add ->from('address@domain.com')
,沒有工作也沒關系。
請檢查您的 smtp 設置
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.