How To create exception for this Bug?
when first Login I got this error It is not a real email. I want to exclude this error
6 Replies
Share error
Symfony\Component\Mailer\Transport\Dsn::__construct(): Argument #2 ($host) must be of type string, null given, called in /var/www/html/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php on line 187
Can you share flare links?
this error action when emailVerification
Ok, the error says i needs string but i got
null
, please give me string so that i can go away π
For $host
With only one line of error it's hard to debug..ok,If I enter with a real email, this error does not appear, but when I enter with the [email protected] email, the error appears
I Fixed It
set this code inside App\Exceptions\Handler.php
public function render($request, Throwable $exception)
{
if ($exception instanceof \Symfony\Component\Mailer\Exception\TransportExceptionInterface) {
// Handle the mail transport exception
return response()->json(['error' => 'Mail configuration error. Please check your environment settings.'], 500);
}
return parent::render($request, $exception);
}