isSMTP(); $mail->Host = $smtp['host']; $mail->Port = (int) $smtp['port']; $mail->SMTPAuth = true; $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; $mail->Username = $smtp['username']; $mail->Password = $smtp['password']; $mail->Timeout = 15; try { if ($mail->smtpConnect()) { $mail->smtpClose(); echo "OK: Verbindung, STARTTLS und Login erfolgreich — keine Mail versendet.\n"; exit(0); } fwrite(STDERR, 'Fehler: ' . ($mail->ErrorInfo !== '' ? $mail->ErrorInfo : 'Verbindung fehlgeschlagen.') . "\n"); exit(1); } catch (Throwable $e) { fwrite(STDERR, 'Fehler: ' . $e->getMessage() . "\n"); exit(1); }