[FIX] Add Support and add address for mailing

This commit is contained in:
Marcus Müller 2019-03-28 13:54:58 +01:00
parent 1b3fdf4e22
commit 9a39bcf15b

View File

@ -1,9 +1,4 @@
<?php <?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
/** /**
* Name: PHP Mailer SMTP * Name: PHP Mailer SMTP
* Description: Connects to a SMTP server based on the config * Description: Connects to a SMTP server based on the config
@ -62,12 +57,10 @@ function phpmailer_emailer_send_prepare(App $a, array &$b)
$mail->Host = $a->config['system']['smtp_server']; $mail->Host = $a->config['system']['smtp_server'];
$mail->Port = $a->config['system']['smtp_port']; $mail->Port = $a->config['system']['smtp_port'];
/*
if (!empty($a->config['system']['smtp_secure']) && (bool)$a->config['system']['smtp_secure'] !== '') { if (!empty($a->config['system']['smtp_secure']) && (bool)$a->config['system']['smtp_secure'] !== '') {
$mail->SMTPSecure = $a->config['system']['smtp_secure']; $mail->SMTPSecure = $a->config['system']['smtp_secure'];
$mail->Port = $a->config['system']['smtp_port_s']; $mail->Port = $a->config['system']['smtp_port_s'];
} }
*/
if (!empty($a->config['system']['smtp_username']) && !empty($a->config['system']['smtp_password'])) { if (!empty($a->config['system']['smtp_username']) && !empty($a->config['system']['smtp_password'])) {
$mail->SMTPAuth = true; $mail->SMTPAuth = true;
@ -86,6 +79,10 @@ function phpmailer_emailer_send_prepare(App $a, array &$b)
// add text // add text
$mail->AltBody = $b['textVersion']; $mail->AltBody = $b['textVersion'];
if (!empty($b['toEmail'])) {
$mail->addAddress($b['toEmail']);
}
// html version // html version
if (!empty($b['htmlVersion'])) { if (!empty($b['htmlVersion'])) {
$mail->isHTML(true); $mail->isHTML(true);