isSMTP(); $mail->Host = $config['smtp']['host']; $mail->SMTPAuth = true; $mail->Username = $config['smtp']['username']; $mail->Password = $config['smtp']['password']; $mail->SMTPAutoTLS = true; $mail->Port = $config['smtp']['port']; // E-Mail-Einstellungen $mail->setFrom($config['smtp']['username'], 'Bar Filipo Kontaktformular'); $mail->addAddress($config['smtp']['recipient']); $mail->isHTML(true); $mail->Subject = 'Neue Nachricht vom Kontaktformular'; $mail->Body = "Name: $name
E-Mail: $email
Nachricht: $message"; $mail->AltBody = "Name: $name\nE-Mail: $email\nNachricht: $message"; $mail->addReplyTo($email, $name); $mail->send(); echo 'Nachricht wurde erfolgreich gesendet.'; } catch (Exception $e) { echo "Fehler beim Senden der Nachricht: {$mail->ErrorInfo}"; } } else { echo 'Ungültige Anfrage'; } ?>