Commit 0f4b158b authored by Skia's avatar Skia

Improve weekmail error handling

parent 2839c079
......@@ -130,8 +130,10 @@ if($_REQUEST['action']
else
{
unset($_REQUEST['page']);
$weekmail->send();
$site->add_contents(new contents(false,'Weekmail envoyé avec succès'));
if($weekmail->send()==True)
$site->add_contents(new contents(false,'Weekmail envoyé avec succès'));
else
$site->add_contents(new contents(false,'Erreur dans l\'envoi du weekmail'));
}
}
......
......@@ -404,16 +404,15 @@ L\'AE';
//'enseignants@utbm.fr',
//'iatoss@utbm.fr',
'personnels@utbm.fr',
'aude.petit@utbm.fr',
'info@ml.aeinfo.net'));
'aude.petit@utbm.fr'));
$this->rendu_html = $this->_render_html();
$this->rendu_txt = $this->_render_txt();
$mailer->set_html($this->rendu_html);
$mailer->set_plain($this->rendu_txt);
$mailer->send();
$this->statut = $mailer->send();
new update($this->dbrw,
'weekmail',
array('statut_weekmail'=>1,
array('statut_weekmail'=>$this->statut,
'date_weekmail'=>date('Y-m-d'),
'rendu_html_weekmail'=>$this->rendu_html,
'rendu_txt_weekmail'=>$this->rendu_txt),
......@@ -421,7 +420,7 @@ L\'AE';
/*new delete($this->dbrw,
'weekmail_news',
array('id_weekmail'=>$this->id));*/
return true;
return $this->statut;
}
public function is_valid( )
......
......@@ -101,11 +101,13 @@ class mailer
else
$msg .= eregi_replace("\\\'","'",str_replace('=','=3D', $this->htmltext))."\n";
$msg .= "--$boundary--\n";
mail(implode(', ',$this->to),
$this->subject,
$msg,
"Reply-to: ".$this->from."\nFrom: ".$this->from."\n".$header);
unset($msg);
if(mail(implode(', ',$this->to),
$this->subject,
$msg,
"Reply-to: ".$this->from."\nFrom: ".$this->from."\n".$header))
return 1;
else
return 0;
}
}
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment