I have a laravel project, this project has "forgot password" plugin.
But when i send reset link to users mail, this link doesnt go to the user mail’s inbox.
It goes to the my smtp account. I am using mailtrap for testing. I want to be able to send mail directly to user’s email. Is it possible to do that with codes. Or should i forward to emails. And how can i do that ? What am i doing wrong ?
What email address they type in this input, reset link should go that email not my mailtrap account.
Password reset link comes here. I dont want that. It has to send reset link to user’s email not my mailtrap account.
Last step should be same but we have to come here from user’s email.
>Solution :
You’re using mailtrap at the moment. This doesn’t send any emails to the real world. To receive an email, you must configure correspondence in your .env file.
Default .env
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
ex: for Gmail
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=mygoogle@gmail.com
MAIL_PASSWORD=password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=mygoogle@gmail.com
MAIL_FROM_NAME="${APP_NAME}"
Check this example – Laravel 9 Send Mail using Gmail SMTP Server and for configurations


