I want to convert my mailing from Swift Mailer to the Mailer Component, since I upgraded to Symfony 4.3.
I've translated my MAILER_URL to a MAILER_DSN, the following way:
MAILER_URL=smtp://smtp.zoho.eu:465?encryption=ssl&auth_mode=login&username=bar@foo.com&password=password123
MAILER_DSN=smtp://bar@foo.com:password123@smtp.zoho.eu:465/?encryption=ssl&auth_mode=login
As you can see, I'm using Zoho as my mail provider.
However, I'm getting the following internal server error:
Expected response code "250" but got an empty response.
I've tried switching from SSL to TLS, with no (different) result.
The code I've written to send my test mail, is as follows:
$email = (new TemplatedEmail())
->from('bar@foo.com')
->to('foo@bar.com')
->subject('Test')
->htmlTemplate('email.html.twig')
->context([
'expiration_date' => new \DateTime('+7 days'),
'username' => 'foo',
])
;
$this->mailer->send($email);
I expect my code to send a mail to "foo@bar.com", but instead it turns the empty response as described.