ask('Email to test email config?'); try { $result = Mail::raw('Test email sent form crm application to check email configuration', function ($message) use ($email){ $message->from(config('mail.from.address')); $message->to($email); $message->subject('Testing email settings'); }); Log::info('Email test sent successfully', [ 'to' => $email, 'from' => config('mail.from.address'), 'result' => $result, 'mail_driver' => config('mail.driver'), 'mail_host' => config('mail.host'), ]); $this->info('Test email sent successfully. Check the Laravel log for details.'); } catch (\Throwable $exception) { Log::error('Email test failed', [ 'to' => $email, 'from' => config('mail.from.address'), 'mail_driver' => config('mail.driver'), 'mail_host' => config('mail.host'), 'error' => $exception->getMessage(), 'trace' => $exception->getTraceAsString(), ]); $this->error('Test email failed: ' . $exception->getMessage()); } } }