<?php use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require_once 'lib/class/phpmailer/Exception.php'; require_once 'lib/class/phpmailer/PHPMailer.php'; require_once 'lib/class/phpmailer/SMTP.php'; class send_smtp_mail{ public function senden($mail_adresse,$betreff,$nachricht){ global $grundconfig; $mailer = new PHPMailer(); $mailer->SMTPDebug = 0; // Enable verbose debug output $mailer->isSMTP(); // Set mailer to use SMTP $mailer->Host = $grundconfig->SMTP_HOST; // Specify main and backup SMTP servers $mailer->SMTPAuth = true; // Enable SMTP authentication $mailer->Username = $grundconfig->SMTP_LOGIN; // SMTP username $mailer->Password = $grundconfig->SMTP_PASS; // SMTP password $mailer->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted $mailer->Port = 465; $mailer->SMTPOptions = array( 'ssl' => array( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true ) ); // TCP port to connect to $mailer->CharSet = 'UTF-8'; // Charset setzen (f�r richtige Darstellung von Sonderzeichen/Umlauten) $mailer->setFrom($grundconfig->betreibermail,$grundconfig->seitenname); // Absenderemail und -name setzen $mailer->addAddress($mail_adresse); // Empf�ngeradresse $mailer->isHTML(true); $mailer->Subject = $betreff; // Betreff der Email $mailer->Body = $nachricht; // Inhalt der Email if(!$mailer->Send()){ return false; }else{ return true; } return $error; } } ?>