From 394e08fd023db3c8db120a29f22f4dcaddedf896 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 24 Apr 2017 15:50:05 +0200 Subject: [PATCH] Errores mail solucionados --- debian/changelog | 2 +- debian/postinst | 1 + rest/misc/mail.php | 12 +++++------- web/mailer.php | 6 +++++- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6a1a9220..5defc29b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.394-deb8) stable; urgency=low +hedera-web (1.397-deb8) stable; urgency=low * Initial Release. diff --git a/debian/postinst b/debian/postinst index 23f7c1b8..13608102 100755 --- a/debian/postinst +++ b/debian/postinst @@ -3,5 +3,6 @@ cd /usr/share/hedera-web && npm install --production a2enconf hedera-web service apache2 reload +service php5-fpm restart service cron restart diff --git a/rest/misc/mail.php b/rest/misc/mail.php index f816b5c8..eec5547d 100755 --- a/rest/misc/mail.php +++ b/rest/misc/mail.php @@ -25,7 +25,7 @@ class Mail extends Vn\Lib\Method $status = 'OK'; try { - //if (!preg_match ('/^[\w\._%-]+@[\w\.-]+\.[A-Za-z]{2,4}$/', $row['to'])) + //if (!preg_match ('/^[\w\._%-]+@[\w\.-]+\.[A-Za-z]{2,4}$/', $mailTo)) // throw new Exception ('Destination mail has invalid sintax'); $mail = new PHPMailer (); @@ -50,14 +50,12 @@ class Mail extends Vn\Lib\Method $mail->setFrom ($conf['sender'], $conf['sender_name']); $mail->AddReplyTo ($row['reply_to'], $conf['sender_name']); - if (strpos ($row['to'], ',')) - $mailList = explode (',', $row['to']); - else - $mailList = explode (';', $row['to']); + $mailList = explode (',', $row['to']); - foreach ($mailList as $mailTo) - $mail->AddAddress ($mailTo); + foreach ($mailList as $to) + $mail->AddAddress ($to); + $mail->IsHTML (TRUE); $mail->Subject = $row['subject']; $mail->Body = ' '. $row['text']; $mail->CharSet = 'UTF-8'; diff --git a/web/mailer.php b/web/mailer.php index 0b9db29b..815ea72c 100755 --- a/web/mailer.php +++ b/web/mailer.php @@ -35,7 +35,11 @@ class Mailer } $mail->setFrom ($conf['sender'], $conf['sender_name']); - $mail->AddAddress ($mailTo); + + $mailList = explode (',', $mailTo); + + foreach ($mailList as $to) + $mail->AddAddress ($to); $mail->IsHTML (TRUE); $mail->Subject = $subject;