mailable = new TestMailServer('Email Server Works!', config('mail.from.address')); $nmo->company = $to_user->account->companies()->first(); $nmo->settings = $to_user->account->companies()->first()->settings; $nmo->to_user = $to_user; try { Mail::raw("Test Message", function ($message) { $message->to(config('mail.from.address')) ->from(config('mail.from.address'), config('mail.from.name')) ->subject('Test Email'); }); } catch(\Exception $e) { $this->info("Error sending email: " . $e->getMessage()); } } }