Skip to content

Commit

Permalink
Merge pull request #1 from JustinBerger/jb-smtp-options
Browse files Browse the repository at this point in the history
Allow setting additional smtp config options
  • Loading branch information
JustinBerger authored May 27, 2019
2 parents a9f1ecc + 19a41b8 commit 7ed1dad
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Illuminate/Mail/TransportManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ protected function createSmtpDriver()
if (isset($config['stream'])) {
$transport->setStreamOptions($config['stream']);
}

// Set the source ip for servers which have more than one ip address.
// This will cause Swift SMTP transport to make requests only via that
// IP address, which is useful for firewalled smtp servers like gmail
// smtp relay.
if (isset($config['sourceip'])) {
$transport->setSourceIp($config['sourceip']);
}

// Allow setting the local domain which Swift SMTP transport will use
// to identify the request domain to the smtp server, which is useful
// for shared smtp servers like gmail's smtp relay.
if (isset($config['localdomain'])) {
$transport->setLocalDomain($config['localdomain']);
}

return $transport;
}
Expand Down

0 comments on commit 7ed1dad

Please sign in to comment.