I am trying to configure the SMTP in Laravel 11 project, but I am contantly getting following error:
Failed to authenticate on SMTP server with username "[email protected]" using the following authenticators: "LOGIN", "PLAIN". Authenticator "LOGIN" returned "Expected response code "235" but got code "535", with message "535 5.7.8 Error: authentication failed: (reason unavailable)".". Authenticator "PLAIN" returned "Expected response code "235" but got code "535", with message "535 5.7.8 Error: authentication failed: (reason unavailable)".".
with following ENV. configuration:
MAIL_MAILER=smtp
MAIL_SCHEME=smtp
MAIL_FROM_NAME="My APP NAME"
MAIL_FROM_ADDRESS="[email protected]"
MAIL_HOST=smtp.hostinger.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=Test123Test+
MAIL_ENCRYPTION=tls
I have checked the password and username milion times + I also followed the hostinger guide: (https://support.hostinger.com/en/articles/4305847-set-up-hostinger-email-on-your-applications-and-devices), contacted the Hostinger helpdesk, but I am still getting the same error.
If I change the SMTP configuration to mailtrap it works like a charm, but there must be something special with HOSTINGER.
I also checked the SMTP TEST TOOL, but I am still getting the same error.
Any clue, what I am doing wrong?
Thx.
PS: Domain was changed – it is just a placeholder
2
Answers
SOLUTON for me was quite easy, but took me quite a lot time to find it (of course w/o hostinger help desk :/ )
MAIL_HOST=smtp.hostinger.com
toMAIL_HOST=smtp.titan.email
and it workshope it helps someone in the future
I had the same problem, but with a different hosting provider – hmara.io. I have a vps server on ubuntu 22 + laravel 11. I wrote to support with this problem, they told me that all providers renting out vps block mail ports by default, especially sending (587).
In order to unblock you need to write a ticket to open the mail ports, I opened literally for 10 minutes and mail worked, I think on hosting will be the same way