skip to Main Content

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.

2

Answers


  1. Chosen as BEST ANSWER

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

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

  2. I had the same problem.

    I solved it changing the deprecated bundle "symfony/swiftmailer-bundle" by the new one "symfony/mailer". Implementation is very similar. (I’m using symonfy 5.4)

    With the same MAILER_DSN string, it works with the new bundle. I don’t know the reason. Probably some new requirement of the ionos servers.

    MAILER_DSN=smtp://mymailaccount%40mydomain.com:[email protected]:587
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search