Skip to content

Commit

Permalink
allow scheme to be specified
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Feb 1, 2023
1 parent c885dbf commit 68a8bfc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Illuminate/Mail/MailManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,16 @@ protected function createSmtpTransport(array $config)
{
$factory = new EsmtpTransportFactory;

$transport = $factory->create(new Dsn(
! empty($config['encryption']) && $config['encryption'] === 'tls'
$scheme = $config['scheme'] ?? null;

if (! $scheme) {
$scheme = ! empty($config['encryption']) && $config['encryption'] === 'tls'
? (($config['port'] == 465) ? 'smtps' : 'smtp')
: '',
: '';
}

$transport = $factory->create(new Dsn(
$scheme,
$config['host'],
$config['username'] ?? null,
$config['password'] ?? null,
Expand Down

0 comments on commit 68a8bfc

Please sign in to comment.