Gon Hunter Gon Hunter - 4 months ago 53
PHP Question

SSL: Broken Pipe Laravel Mail Class

$email = $request['email'];
Mail::send('mail/index', ['user' => 'website.com'], function ($m) use($email) {
$m->from('any@gmail.com', 'my Team');
$m->to($email)->subject('View our website');

It gives me an error.

ErrorException in StreamBuffer.php line 232. fwrite(): SSL: Broken pipe.
in StreamBuffer.php line 232
at HandleExceptions->handleError('2', 'fwrite(): SSL: Broken pipe','/home/vagrant/Code/dummy/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php', '232', array('bytes' => 'QUIT ', 'bytesToWrite' => '6', 'totalBytesWritten' => '0'))
thank in advance.


It's trying to send QUIT to signal the whole thing has finished and is ready to close the connections.

The problem is, SwiftMailer closes the connection before sending the last command.

Bugreport: https://github.com/swiftmailer/swiftmailer/issues/490

Fixing Pull Request: https://github.com/laravel/framework/pull/13583

The PR has been merged, so you would simply need to update to a more recent version of SwiftMailer.