MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

How to Setup Laravel default password reset mail

Most web applications provide a way for users to reset their forgotten passwords. Rather than forcing you to re-implement this on each application, Laravel provides convenient methods for sending password reminders and performing password resets.

Laravel includes Auth\ForgotPasswordController and Auth\ResetPasswordController classes that contains the logic necessary to e-mail password reset links and reset user passwords. All of the routes needed to perform password resets may be generated using the php artisan make:auth Composer package:

Laravel Reset Password form with E-Mail Address field and Send Password Reset Link button

Once you have defined the routes and views to reset your user’s passwords, you may access the route in your browser at /password/reset. The ForgotPasswordController included with the framework already includes the logic to send the password reset link e-mails, while the ResetPasswordController includes the logic to reset user passwords.

After a password is reset, the user will automatically be logged into the application and redirected to /home. You can customize the post password reset redirect location by defining a redirectTo property on the ResetPasswordController:

You just need to make some changes on .env , you can find these lines in your env file We are using Gmail SMTP Server to send Email in Laravel for this.

1:- Creating / Using an existing Gmail account to create app passwords.

I’m using my existing Gmail account, butt in case if you wish to create a new account you can go for that also, Clink on this LINK to create one

Next we need to enable 2 step Verification in Gmail as follows:

  • Login into Gmail .
  • To be able to create app passwords we need to first enable 2 Step Verification .
  • Click on the user icon and select “Google Account” .
  • Next we need to select Security from the left nav , then select “2 Step Verification” . (Doing this would ask you to login again and then Gmail would authenticate you further using OTP )
Google Account Security page showing 2-Step Verification on and App passwords option
  • Now we generate the app password that we would be using in the Laravel Application , again clicking on the Google Account in the user icon ->Security ->App Passwords . (This would again ask you to login and then authenticate using OTP)
  • We need to select “Mail” as the app and “Other (Custom name)” as the device from the drop downs .
  • Selecting this would ask you to add the name of the Application for which you wish to generate the password and once added click GENERATE.
  • This would open a pop up with your 16 character app password . (Kindly copy this and keep it safe).
  • We are all set to add these detail’s to the Application.

2. Adding Gmail Account detail’s to the Laravel Application:

  • We need to edit the following in the .env file

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

with

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=youraccount@gmail.com
MAIL_PASSWORD=yourapppassword
MAIL_ENCRYPTION=ssl

  • There is no need for us to make any change in the config/mail.php file , since it would pick the values from the .env file.

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals

Related Posts

PHP Code for Godaddy VPS Server SMTP Email Relay

This page shows how to send email from a GoDaddy VPS through GoDaddy's SMTP relay on port 25 with plain PHP sockets and no extra libraries. Below…

Read More

Email Authentication & Communication Infrastructure in Modern DevOps: The 2026 Definitive Guide

In the high-stakes world of modern DevOps, we spend our days (and sometimes our nights) obsessing over the “golden signals” of site reliability: latency, traffic, errors, and…

Read More

The 5 Most Popular Email APIs Among Developers In 2026

In the modern world, where everything is going digital, email is among the most important means of communication both in personal and business life. As a developer,…

Read More

Senior Exchange Administrator: Role Blueprint, Responsibilities, Skills, KPIs, and Career Path

The Senior Exchange Administrator is accountable for the reliability, security, performance, and lifecycle management of the organization’s Microsoft messaging platform, typically spanning Exchange Online (Microsoft 365), Exchange Server (on-premises), or a hybrid configuration. This role ensures email and calendaring services are highly available, compliant, and aligned to business needs while proactively reducing operational risk and improving user experience.

Read More

Principal Exchange Administrator: Role Blueprint, Responsibilities, Skills, KPIs, and Career Path

The Principal Exchange Administrator is the senior technical authority responsible for the reliability, security, lifecycle, and operational excellence of the enterprise messaging platform—typically Microsoft Exchange Online/Exchange Server in a hybrid Microsoft 365 environment. This role exists to ensure email and calendaring services remain highly available, performant, compliant, and aligned with enterprise security and governance requirements while enabling modern collaboration capabilities across the organization.

Read More

Lead Exchange Administrator: Role Blueprint, Responsibilities, Skills, KPIs, and Career Path

The Lead Exchange Administrator owns the reliability, security, and operational excellence of the organization’s messaging platform, typically Microsoft Exchange Online (Microsoft 365) and/or a hybrid Exchange deployment with on‑premises Exchange servers. This role ensures email and calendaring services remain highly available, performant, compliant, and resilient, while continuously improving automation, monitoring, and service management maturity.

Read More