Search code examples
phplaravelauthenticationpostmanreset-password

Laravel 5.5 : Not receiving password reset link mail


I am using hostgators/AWS smtp service. everything is good . my mail function is working great as i am able to send all my forms data on my website. but when i am trying to reset password (forgot password?) ...when i click send reset link it is showing that link has been sent (please check screenshot ) .. but i am not getting any mail. i have tried to send mails to different registered users but not getting that reset link . i have created this login system using php artisan make:auth .

If I tested with POSTMAN or any API client it is working but once I implemented it with the application it is not working.

more details will be provided if needed.enter image description here


Solution

  • In .env file add new variable called MAIL_FROM_ADDRESS=your_smtp_from_mail_id . you have to set MAIL_FROM_ADDRESS to valid smtp from_mail email id. sometimes in .env file this variable doesn't exist. if it is not set manually ; when sending mail it is picking up a default mail id which is hello@example.com. please have look here config/mail.php

    'from' => [
        'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
        'name' => env('MAIL_FROM_NAME', 'Example'),
    ],
    

    i think this should work !

    This worked for me .