I am desperately trying to send emails via my Symfony 6 application using my OVH E-mails Pro address.
The address is functional in the sense that I can send emails via an email client, but I can’t do it from my Symfony application.
I created a small controller:
#[Route('/test-email', name: 'test_email')]
public function sendTestEmail(): Response
{
$email = (new Email())
->from('[email protected]')
->to('[email protected]')
->subject('Test Email')
->text('This is a test email.');
$this->mailer->send($email);
return new Response('Test email sent!');
}
I have tried a bunch of possible configurations:
MAILER_DSN=smtp://myadresse%40mydomain.pro:[email protected]:587?encryption=tls&auth_mode=login
MAILER_DSN=smtp://myadresse%40mydomain.pro:[email protected]:465?encryption=ssl&auth_mode=login
MAILER_DSN=smtp://myadresse%40mydomain.pro:[email protected]:465?encryption=ssl&auth_mode=login&verify_peer=false
MAILER_DSN=smtp://myadresse%40mydomain.pro:[email protected]:587
MAILER_DSN=smtp://myadresse%40mydomain.pro:[email protected]:587?encryption=tls&auth_mode=login
MAILER_DSN=smtp://myadresse%40mydomain.pro:[email protected]:587?encryption=tls&auth_mode=login&verify_peer=false
MAILER_DSN=smtp://[email protected]:[email protected]:587?encryption=tls&auth_mode=login
MAILER_DSN=smtp://[email protected]:[email protected]:465?encryption=ssl&auth_mode=login
None of them work.
What is the correct MAILER_DSN configuration line for an OVH pro address?
Thank you for your help.