Errores mail solucionados

This commit is contained in:
Juan Ferrer Toribio 2017-04-24 15:50:05 +02:00
parent 6eda62a5dc
commit 394e08fd02
4 changed files with 12 additions and 9 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.394-deb8) stable; urgency=low
hedera-web (1.397-deb8) stable; urgency=low
* Initial Release.

1
debian/postinst vendored
View File

@ -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

View File

@ -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';

View File

@ -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;