Skip to content

Commit 9541779

Browse files
author
Nicola Lazzaro
authored
Connection could not be established with host smtp and a different port from 465 with tls enabled #40887 (#40943)
Resolve this issue: #40887
1 parent 0feef93 commit 9541779

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Mail/MailManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ protected function createSmtpTransport(array $config)
171171
$factory = new EsmtpTransportFactory;
172172

173173
$transport = $factory->create(new Dsn(
174-
! empty($config['encryption']) && $config['encryption'] === 'tls' ? 'smtps' : '',
174+
! empty($config['encryption']) && $config['encryption'] === 'tls' ? (($config['port'] == 465) ? 'smtps' : 'smtp') : '',
175175
$config['host'],
176176
$config['username'] ?? null,
177177
$config['password'] ?? null,

0 commit comments

Comments
 (0)