Files
code-cegled/_include/include_send_report.php
2020-07-12 14:39:57 +02:00

33 lines
1.6 KiB
PHP

<?php
$mail = new PHPMailer(true); // Passing `true` enables exceptions
try {
//Server settings
$mail->SMTPDebug = 0; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->CharSet = PHPMailer::CHARSET_UTF8; // UTF-8
$mail->Host = 'mail.livingsport.hu '; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'notify@livingsport.hu'; // SMTP username
$mail->Password = 'dpDiKSqU0V'; // SMTP password
$mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 465; // TCP port to connect to
//Recipients
$mail->setFrom("notify@livingsport.hu", "Badminton Coach értesítő");
$mail->addAddress("info@livingsport.hu", "Nagy Krisztián");
$mail->addBCC('tricsusz@gmail.com', 'Tóth Richárd'); // TEST
//Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = "Havi egyenleg lista";
$mail->Body = "Az előző havi egyenleglista elérhető az alábbi linkről: http://badminton.livingsport.hu/admin/download_report/".date("Y-m", strtotime("-1 month"));
//send mail
$mail->send();
} catch (Exception $e) {
}