diff --git a/src/TransportManager.php b/src/TransportManager.php index 3082a2d..52e2c83 100644 --- a/src/TransportManager.php +++ b/src/TransportManager.php @@ -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; }