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".
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
using symfony 6 with ionos server (in france !), the MAILER_DSN should be :
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.