10

I am using Laravel 5.2. I am using Mail queue for sending email. Following is email queue syntax.

$mailArr = array();
$mailArr['subject'] = 'testing mail';
$mail_body = 'testing mail';
$mailArr['description'] =  $mail_body;
Mail::to($email)->queue(new CustomMail($mailArr));
  • If I use "send" instead of "queue" then successfully receiving email.
  • Queue emails are going in Job table and attempting 3 times and then it is going in failed_jobs table.
  • In failed_jobs table, I am getting error ErrorException: fwrite(): SSL: Broken pipe in vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:231
  • I am processing queue with dispatcher and supervisor.
  • If I manually hit php artisan queue:work even then email is going but automatically with schedule:run written in cron job, is not working.

So any suggestions please what could be the reason?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Jass
  • 3,345
  • 3
  • 24
  • 41

1 Answers1

1

This response is received when the remote connection closes without informing your server as to why. Usually due to a restriction, such as mail size.

Try using an alternative mailer, such as Mailtrap for example and try the queue again to see if the error response is different.

It is likely you had a plumbing issue; a huge email in your queue prior to your other emails, that’s why sends were processing fine but your queue wasn’t.

Grant
  • 5,709
  • 2
  • 38
  • 50