Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
all(); $email = $requestData['email']; $user = User::where('email', $email)->firstOrFail(); // Use firstOrFail() to throw an exception if user is not found $user->verification_token = Hash::make(Carbon::now()); $user->save(); $responseUrl = url('/change-password/verify?verification_id=').$user->verification_token; Mail::to('recipient@example.com')->send(new ForgotPassword($responseUrl)); return redirect()->back()->with('status', 'Password reset email sent'); } catch (\Exception $e) { // Check if the exception is a Swift_TransportException (SMTP exception) if ($e instanceof Swift_TransportException) { // Handle SMTP exception return redirect()->back()->with('error', 'SMTP error: ' . $e->getMessage()); } else { // Handle other exceptions return redirect()->back()->with('error', 'The Email Address Provided Does Not Exist'); } } } }