Skip to content

Commit

Permalink
Merge pull request #3 from AlirezaSedghi/master
Browse files Browse the repository at this point in the history
Add support of the additional SMTP driver options
  • Loading branch information
iwasherefirst2 authored Feb 4, 2020
2 parents f035328 + e5ed992 commit fff4e8e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/TransportManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,30 @@ public static function createSmtpDriver($config)
$transport->setUsername($setting['username'] ?? $config->getEmail());
$transport->setPassword($setting['pass']);

return self::configureSmtpDriver($transport, $provider);
}

/**
* Configure the additional SMTP driver options.
*
* @param \Swift_SmtpTransport $transport
* @param array $config
* @return \Swift_SmtpTransport
*/
protected static function configureSmtpDriver($transport, $config)
{
if (isset($config['stream'])) {
$transport->setStreamOptions($config['stream']);
}

if (isset($config['source_ip'])) {
$transport->setSourceIp($config['source_ip']);
}

if (isset($config['local_domain'])) {
$transport->setLocalDomain($config['local_domain']);
}

return $transport;
}

Expand Down

0 comments on commit fff4e8e

Please sign in to comment.