diff --git a/formulaires/envoi_malettre.php b/formulaires/envoi_malettre.php index 9845009..8bd5b6f 100644 --- a/formulaires/envoi_malettre.php +++ b/formulaires/envoi_malettre.php @@ -191,39 +191,15 @@ function formulaires_envoi_malettre_traiter_dist(){ $j = 0; if (is_array($destinataire)) { foreach ($destinataire as $k=>$adresse) { // envoi a tous les destinataires - if (!defined('_DIR_PLUGIN_FACTEUR')){ - include_spip("lib/class.phpmailer"); // mettre à jour http://code.google.com/a/apache-extras.org/p/phpmailer/ ou necessite facteur ? - $mail = new PHPMailer(); - - $mail->From = "$exp_email"; - $mail->FromName = "$exp_name"; - $mail->AddReplyTo("$exp_email"); - $mail->AddAddress($adresse,$adresse); - $i++; - - $mail->WordWrap = 50; // set word wrap - $mail->IsHTML(true); // send as HTML - $mail->CharSet = "utf-8"; - - $mail->Subject = "$lettre_title"; - - $adresse_nom = $destinataire_nom[$k]; - $recup_tmp = str_replace("{NOM_LISTE}",$adresse_nom,$recup); - $recup_txt_tmp = str_replace("{NOM_LISTE}",$adresse_nom,$recup_txt); - - $mail->Body = $recup_tmp; - $mail->AltBody = $recup_txt_tmp; - $res = $mail->Send(); - } else { // envoi via facteur - $envoyer_mail = charger_fonction('envoyer_mail','inc'); - $corps = array( + // envoi via facteur + $envoyer_mail = charger_fonction('envoyer_mail','inc'); + $corps = array( "html" => $recup, "texte" => $recup_txt, "nom_envoyeur" => $exp_name, "from" => $exp_email - ); - $res = $envoyer_mail($destinataire,$lettre_title,$corps); - } + ); + $res = $envoyer_mail($destinataire,$lettre_title,$corps); if (!$res) { $message.= "