DH_Alumni/submit.php
2021-04-21 10:17:02 +02:00

31 lines
633 B
PHP

<?php
//if ($_SERVER['REQUEST_METHOD'] != "POST") {
// die();
//}
use PHPMailer\PHPMailer\PHPMailer;
$config = getConfig();
$mail = new PHPMailer(true);
$mail->Host = $config['mail_server'];
$mail->Port = $config['mail_port'];
$mail->Username = $config['mail_user'];
$mail->Password = $config['mail_password'];
$mail->From = $config['mail_address'];
$mail->FromName = 'Mailer';
$mail->addAddress('test@joethei.de', 'Joe User');
$mail->Subject = 'Here is the subject';
$mail->Body = 'This is the HTML message body <b>in bold!</b>';
try {
!$mail->send();
} catch (\PHPMailer\PHPMailer\Exception $e) {
echo $e;
}