Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.1] Yet another attempt to fix Swift Mailer related SSL failures (Issue #4573) #13583

Merged
merged 8 commits into from
Jun 11, 2016
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions src/Illuminate/Mail/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ public function plain($view, array $data, $callback)
*/
public function send($view, array $data, $callback)
{
$this->forceReconnection();

// First we need to parse the view, which could either be a string or an array
// containing both an HTML and plain text versions of the view which should
// be used when sending an e-mail. We will extract both of them out here.
Expand Down Expand Up @@ -303,18 +301,6 @@ protected function getQueuedCallable(array $data)
return $data['callback'];
}

/**
* Force the transport to re-connect.
*
* This will prevent errors in daemon queue situations.
*
* @return void
*/
protected function forceReconnection()
{
$this->getSwiftMailer()->getTransport()->stop();
}

/**
* Add the content to a given message.
*
Expand Down Expand Up @@ -392,7 +378,10 @@ protected function sendSwiftMessage($message)
}

if (! $this->pretending) {
return $this->swift->send($message, $this->failedRecipients);
$result = $this->getSwiftMailer()->send($message, $this->failedRecipients);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't modify this line

$this->getSwiftMailer()->getTransport()->stop();
Copy link
Member

@GrahamCampbell GrahamCampbell May 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do a try finally here.


return $result;
} elseif (isset($this->logger)) {
$this->logMessage($message);
}
Expand Down