Browse Source

Fixes #67: Test if transport is gone each time someone tries to send email, not if connection is initially made

tags/2.1.2
Mikk Tendermann 6 years ago committed by Alexander Makarov
parent
commit
a8f2b942dd
  1. 1
      .travis.yml
  2. 1
      CHANGELOG.md
  3. 10
      src/Mailer.php

1
.travis.yml

@ -14,6 +14,7 @@ cache:
- $HOME/.composer/cache
install:
- sudo apt-get install -y sendmail
- travis_retry composer self-update && composer --version
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- travis_retry composer install --prefer-dist --no-interaction

1
CHANGELOG.md

@ -6,6 +6,7 @@ Yii Framework 2 swiftmailer extension Change Log
- Enh #63: Added ability to specify the disposition of an attachment by supplying a `setDisposition` value when embedding content in a message (CorWatts)
- Bug #67: If transport is gone, try to restart transport (mikk150)
- Bug #67: Test if transport is gone each time someone tries to send email, not if connection is initially made (mikk150)
2.1.1 April 25, 2018
--------------------

10
src/Mailer.php

@ -108,6 +108,11 @@ class Mailer extends BaseMailer
$this->_swiftMailer = $this->createSwiftMailer();
}
if (!$this->_transport->ping()) {
$this->_transport->stop();
$this->_transport->start();
}
return $this->_swiftMailer;
}
@ -133,11 +138,6 @@ class Mailer extends BaseMailer
$this->_transport = $this->createTransport($this->_transport);
}
if (!$this->_transport->ping()) {
$this->_transport->stop();
$this->_transport->start();
}
return $this->_transport;
}

Loading…
Cancel
Save