31 lines
633 B
PHP
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;
|
||
|
}
|