Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

IsaacBen's avatar

Password forgot error

So my website is hosted in Digital Ocean, and when I try to test the password forgot I get an error.

"Swift_TransportException in AuthHandler.php line 181: Failed to authenticate on SMTP server with username "itzik" using 2 possible authenticators"

Any idea about this? Do I need to add something in the mail.php file?

0 likes
12 replies
IsaacBen's avatar

So I added my personal gmail, and it says "We have e-mailed your password reset link! " , but I haven't received any email.

'from' => ['address' => 'myemail@gmail.com', 'name' => 'No reply'],
Penderis's avatar

First check spam if it says it has sent but you are not receiving. Other you are using php mail or smtp ? if smtp did you add the correct smtp info this is your mail account information like when you setup outlook usually mail.yourdomain.com (non-ssl) also if you are using a non ssl (tls) make sure this is disabled for laravel or enabled depending on your smtp host.

I had to remove the tls setting in a previous project then my mail worked again.

IsaacBen's avatar

@Penderis Now I get this error,

"Expected response code 250 but got code "535", with message "535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/answer/14257 c35sm1194028qgc.47 - gsmtp "

Then gmail sent me that they blocked this ip from accessing my email.

Penderis's avatar

I'm just going to install laravel quick. But for that error is because you are trying to send mail using googles smtp, you should be using your own hosts smtp else use php mail function . can you post your email config in laravel excluding passwords.

IsaacBen's avatar

I'm new at this so I'm trying the easy and free way

<?php

return [


    'driver' => env('MAIL_DRIVER', 'smtp'),

    'host' => env('MAIL_HOST', 'smtp.gmail.com'),

    'port' => env('MAIL_PORT', 587),

    'from' => ['address' => 'myemail@gmail.com', 'name' => 'No reply'],

    'encryption' => 'tls',

    'username' => env('MAIL_USERNAME'), -->Have it set up in the env at Forge

    'password' => env('MAIL_PASSWORD'), -->-->Have it set up in the env at Forge

    'sendmail' => '/usr/sbin/sendmail -bs',

    'pretend' => false,

];
IsaacBen's avatar

@Penderis Yeah, I looked at it but I haven't seen an option like that in my google account, they are not allowing me to approve what they blocked. I know it's not related but after the reset I'm being redirected to /home, where can I change it to be just / instead?

Penderis's avatar

Ok so I did as mentioned in link above , allowed the sign in from unknown device in my googel security settings then also enabled less secure app access. So if ever using google security will be the problem.

I still think you should just use your digital ocean account for emails , even shared hosting has this available.

1 like
Penderis's avatar
Level 3

What reset? Redirect? You will only get redirected if you added a redirect to the callback, in that case look for redirect('/home') and make it ('/') I think, or do not redirect and just flash success to page.

IsaacBen's avatar

Thanks buddy, now lets hope it won't break :)

Please or to participate in this conversation.