Skip to content

Commit

Permalink
Add support of the additional SMTP driver options
Browse files Browse the repository at this point in the history
  • Loading branch information
AlirezaSedghi committed Feb 4, 2020
1 parent f035328 commit e5ed992
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 e5ed992

Please sign in to comment.