Unable to send mail trying to access array offset on value of type null

142 Views Asked by At

I'm trying to send an email using Laravel 5.6. I created mail using php artisan make:mail forgotPassword -m forgot_password. for some reason i'm unable to use php artisan make:auth for forgot password and reset. Then i create a ForgotPasswordController to send the email.

use App\Mail\ForgotPassword;
use Illuminate\Support\Facades\Mail;
.
.
.
public function forgot_password(Request $request)
{
  Mail::to('[email protected]')->send(new ForgotPassword);
}

i'm using mailtrap for now to check if it's succeed. my env

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=587
MAIL_USERNAME=00cb7939681e9
MAIL_PASSWORD=9232f1eb4a697
MAIL_ENCRYPTION=tls

for some reason i got an error

Trying to access array offset on value of type null

0

There are 0 best solutions below