Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Set smtp as default scheme which is in the supported schemes list from Symfony Mailer #53705

Closed

Conversation

gabsource
Copy link

Fix #53704

Description:
This pull request addresses an issue introduced by Symfony Mailer 7.2.0, where the UnsupportedSchemeException is thrown if the specified scheme is not explicitly set to smtp or smtps. Currently, MailManager::createSmtpTransport sets the scheme to an empty string ("") by default, which is no longer supported.

The change ensures the default scheme is explicitly set to smtp to maintain compatibility with Symfony Mailer 7.2.0 and prevent runtime errors.

Relevant Change in Symfony Mailer:

symfony/mailer@v7.1.6...v7.2.0#diff-034fdf635bc919f1ba58fb3cac83ce59f111a73c1ee72d63055f752c4b3668dd

Steps to Reproduce:

  • Update composer dependencies to use Symfony Mailer 7.2.0 or later.
  • Configure the mail driver with an smtp transport in Laravel.
  • Attempt to send an email.
  • Observe the exception:
Symfony\Component\Mailer\Exception\UnsupportedSchemeException: The "" scheme is not supported; supported schemes for mailer "smtp" are: "smtp", "smtps".

Benefit to End Users:
This fix ensures that users leveraging the smtp transport in Laravel's mail configuration do not encounter errors after updating their dependencies. It provides a seamless experience and prevents breaking changes when using Symfony Mailer 7.2.0+.

Impact on Existing Features:
This change does not break any existing features or functionality. It simply ensures compatibility with the latest Symfony Mailer updates.

@gabsource gabsource changed the title Set smtp as default scheme which is in the supported schemes list from Symfony Mailer [11.x] Set smtp as default scheme which is in the supported schemes list from Symfony Mailer Nov 29, 2024
@crynobone
Copy link
Member

crynobone commented Nov 29, 2024

Can you share the content of your mail.php configuration file for reference (especially port and encryption value)?

We might need to add additional test here.

@gabsource
Copy link
Author

gabsource commented Nov 29, 2024

We do not override the config/mail.php file so we are using the one provided by the framework but we have MAIL_ENCRYPTION=null in .env which overrides the default tlsfrom the config file.

@crynobone
Copy link
Member

symfony/mailer doesn't use encryption value but instead rely on smtp port to indicate smtp. I believe it should be safe to remove that

@crynobone
Copy link
Member

@crynobone
Copy link
Member

Hi there,

PR #53585 has been merged.

@crynobone crynobone closed this Nov 29, 2024
@gabsource gabsource deleted the fix-53704-smtp-mailer-scheme branch November 29, 2024 14:06
@LocalHeroPro
Copy link

Please reopen, because that PR doesn't resolve issue.

Issue still exists: #53718

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MailManager fails with UnsupportedSchemeException since Symfony Mailer 7.2.0
3 participants