argument('to') ?: config('fewo.notification_email')); $mailer = (string) config('mail.default'); $redirect = Settings::mailRedirect(); $this->line("Versandweg: {$mailer}".($mailer === 'smtp' ? ' ('.config('mail.mailers.smtp.host').':'.config('mail.mailers.smtp.port').')' : '').' · Absender: '.config('mail.from.address')); if (filled($redirect)) { $this->line("Umleitung aktiv: die Mail geht an {$redirect} statt an {$to}."); } if ($mailer === 'log') { $this->warn('Versandweg "log": es wird nichts zugestellt. Zum echten Versand MAIL_MAILER=smtp und MAIL_PASSWORD setzen (docs/BETRIEB.md §5a).'); } try { Mail::raw("Testmail der Ferienwohnung Stommer\n\nGesendet am ".now()->format('d.m.Y H:i:s').' von '.config('app.url').".\nWenn diese Mail ankommt, funktioniert der Versand.", function ($message) use ($to): void { $message->to($to)->subject('Testmail Ferienwohnung Stommer – '.now()->format('d.m.Y H:i')); }); } catch (Throwable $exception) { $this->error('Versand fehlgeschlagen: '.$exception->getMessage()); return self::FAILURE; } $this->info('Übergeben an den Mailserver – bitte Posteingang (und Spam-Ordner) prüfen.'); return self::SUCCESS; } }