Context
In Symfony 4.3 a new emailer was introduced.
See here:
- https://symfony.com/blog/new-in-symfony-4-3-mailer-component
- https://symfony.com/doc/4.4/mailer.html.
For the SMTP transport it is established that the DSN in the ENV var has this format:
MAILER_DSN=smtp://user:pass@smtp.example.com
Question
How do I handle special characters in the user and password when writing the DSN?
Let's suppose that the credentials are:
username: alice@example.com
password: the:password:is:difficult
Setting like this most likely will fail:
MAILER_DSN=smtp://alice@example.com:the:password:is:difficult@smtp.example.com
How should I encode/escape things? What would be a correct DSN for it?