symfony / swiftmailer-bundle

Symfony Swiftmailer Bundle
https://symfony.com/swiftmailer-bundle
MIT License
1.56k stars 151 forks source link

Suggestion: Make MAILER_URL syntax in `.env` consistent with Doctrine #276

Closed ThomasLandauer closed 5 years ago

ThomasLandauer commented 5 years ago

This is a follow up of https://github.com/symfony/symfony/issues/30316

I'm suggesting to change the syntax of MAILER_URL for smtp:// in .env from

MAILER_URL=smtp://localhost:25?encryption=ssl&username=&password=

to

MAILER_URL=smtp://username:password@localhost:25?encryption=ssl

Arguments:

  1. The syntax username:password@host has been around for some time and is even mentioned in the RFC (albeit partly deprecated): https://tools.ietf.org/html/rfc3986#section-3.2.1

  2. Doctrine uses it too: https://symfony.com/doc/current/doctrine.html#configuring-the-database

  3. It's already in use for gmail://: https://symfony.com/doc/current/email.html#using-gmail-to-send-emails

ThomasLandauer commented 5 years ago

Just noticing that this is already possible for the url configuration parameter: https://symfony.com/doc/current/reference/configuration/swiftmailer.html#url

So is what I'm asking for already implemented in the code and just needs to be documented at https://symfony.com/doc/current/email.html#configuration and in .env.dist?

eeemarv commented 5 years ago

234 duplicate (PR #263)