Skip to content

Commit c07f426

Browse files
authored
adjust MailManager to detect if smtp or smtps is needed by checking encryption (#53749)
1 parent 2edd9a9 commit c07f426

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Illuminate/Mail/MailManager.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ protected function createSmtpTransport(array $config)
194194
$scheme = $config['scheme'] ?? null;
195195

196196
if (! $scheme) {
197-
$scheme = ($config['port'] == 465) ? 'smtps' : 'smtp';
197+
$scheme = ! empty($config['encryption']) && $config['encryption'] === 'tls'
198+
? 'smtps'
199+
: 'smtp';
198200
}
199201

200202
$transport = $factory->create(new Dsn(

0 commit comments

Comments
 (0)