Search code examples
phpsymfonyenvironment-variablessmtpsendmail

Symfony MAILER_DSN SMTP authentication error with IONOS: Expected response code "250" but got code "530", with message "530 Authentication required


I am working on a Symfony project and trying to configure the MAILER_DSN in the .env file to send emails using the SMTP server of my email provider, IONOS.

I have set up the MAILER_DSN with the correct server name (smtp.ionos.fr), port number (465), encryption (ssl), and authentication mode (login). I have also verified that the username ([email protected]) and password (blabla@2021) are correct.

However, when I try to send an email, I get the following error:

Expected response code "250" but got code "530", with message "530 Authentication required".

enter image description here

Here's my .env file :

MAILER_DSN=smtp://smtp.ionos.fr:465?encryption=tls&auth_mode=login&[email protected]&password=blabla@2021

I have already tried changing the authentication mode to cram-md5 and plain, using a different port number (587), and verifying that the SMTP server name and port number are correct. I have also checked if two-factor authentication is enabled for my email account, but it is not.

What else can I try to resolve this SMTP authentication error with Symfony and IONOS? Any suggestions or insights would be greatly appreciated.


Solution

  • using symfony 6 with ionos server (in france !), the MAILER_DSN should be :

    MAILER_DSN=smtp://[email protected]:[email protected]:465