I did a fresh install of Symfony 5.4. I've followed the documentation to send an email from my own smtp server but can't get it to work. So I'm trying to use the following configuration of https://mailtrap.io/ without success. Any help would be greatly appreciated.
composer requires symfony/mailer
composer requires symfonycasts/verify-email-bundle
MAILER_DSN=smtp://d62b667a28d6af:023c577a51bb51@smtp.mailtrap.io:2525 #MAILER_DSN=smtp://d62b667a28d6af:023c577a51bb51@smtp.mailtrap.io:2525?encryption=tls&auth_ mode=Login
Register Controller
... // generate a signed url and email it to the user $this->emailVerifier->sendEmailConfirmation('app_verify_email', $user, (new TemplatedEmail()) ->from(new Address('registration@my_host.com', 'Registration Confirmation')) ->to($user->getEmail()) ->subject('Please Confirm your Email') ->htmlTemplate('registration/confirmation_email.html.twig') );
mailer.yml
framework: mailer: dsn: '%env(MAILER_DSN)%'
Running Composer requires symfony/messenger Then Run php bin/console messenger:consume async