]> git.mxchange.org Git - friendica-addons.git/commitdiff
[FIX] Add Support and add address for mailing
authorMarcus Müller <25648755+M-arcus@users.noreply.github.com>
Thu, 28 Mar 2019 12:54:58 +0000 (13:54 +0100)
committerMarcus Müller <25648755+M-arcus@users.noreply.github.com>
Thu, 28 Mar 2019 12:55:46 +0000 (13:55 +0100)
phpmailer/phpmailer.php

index 89cbfb65f7bf86a621aa634b2835d73d3de01510..71392e1c2c10cda7a08cae4d59a996995b14c6bf 100644 (file)
@@ -1,9 +1,4 @@
 <?php
-
-ini_set('display_errors', 1);
-ini_set('display_startup_errors', 1);
-error_reporting(E_ALL);
-
 /**
  * Name: PHP Mailer SMTP
  * 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->Port = $a->config['system']['smtp_port'];
 
-                       /*
                        if (!empty($a->config['system']['smtp_secure']) && (bool)$a->config['system']['smtp_secure'] !== '') {
                                $mail->SMTPSecure = $a->config['system']['smtp_secure'];
                                $mail->Port = $a->config['system']['smtp_port_s'];
                        }
-                       */
 
                        if (!empty($a->config['system']['smtp_username']) && !empty($a->config['system']['smtp_password'])) {
                                $mail->SMTPAuth = true;
@@ -86,6 +79,10 @@ function phpmailer_emailer_send_prepare(App $a, array &$b)
                // add text
                $mail->AltBody = $b['textVersion'];
 
+               if (!empty($b['toEmail'])) {
+                       $mail->addAddress($b['toEmail']);
+               }
+
                // html version
                if (!empty($b['htmlVersion'])) {
                        $mail->isHTML(true);