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 7 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
8 changes: 5 additions & 3 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 @@ -392,7 +390,11 @@ protected function sendSwiftMessage($message)
}

if (! $this->pretending) {
return $this->swift->send($message, $this->failedRecipients);
try {
return $this->swift->send($message, $this->failedRecipients);
} finally {
$this->getSwiftMailer()->getTransport()->stop();
Copy link
Member

Choose a reason for hiding this comment

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

$this->swift->getTransport()->stop()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Kind of inconsistent here anyway since Mailer::forceReconnection() uses the public getter, but I've changed it according to your comment.

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