Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d5f4cf2

Browse files
bug #51042 [Mailer] [Mailgun] Disable tls for mailgun as it should use STARTTLS (joelwurtz)
This PR was merged into the 6.3 branch. Discussion ---------- [Mailer] [Mailgun] Disable tls for mailgun as it should use STARTTLS | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | Since symfony 6.3 smtp mailgun use 587 as default port with tls true, but it does not work : ![image](https://github.com/symfony/symfony/assets/90466/807aff57-00f8-46cf-b137-db5210f9ebd6) Setting tls to false, force the smtp transport to try to use STARTTLS if available like others smtp providers (mailchimp in example) Commits ------- 26395d4 fix(mailgun-smtp): disable tls for mailgun as it should use starttls instead
2 parents ee2e517 + 26395d4 commit d5f4cf2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Mailer/Bridge/Mailgun/Transport/MailgunSmtpTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class MailgunSmtpTransport extends EsmtpTransport
2424

2525
public function __construct(string $username, #[\SensitiveParameter] string $password, string $region = null, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
2626
{
27-
parent::__construct('us' !== ($region ?: 'us') ? sprintf('smtp.%s.mailgun.org', $region) : 'smtp.mailgun.org', 587, true, $dispatcher, $logger);
27+
parent::__construct('us' !== ($region ?: 'us') ? sprintf('smtp.%s.mailgun.org', $region) : 'smtp.mailgun.org', 587, false, $dispatcher, $logger);
2828

2929
$this->setUsername($username);
3030
$this->setPassword($password);

0 commit comments

Comments
 (0)