CharSet = $charset; if ($copie_CC) $destinataires_CC = explode(";",$copie_CC) ; else $destinataires_CC = array(); if ($copie_BCC) $destinataires_BCC = explode(";",$copie_BCC) ; else $destinataires_BCC = array(); $destinataires = explode(";",$to_mail) ; switch ($param[0]) { case 'smtp': // $pmb_mail_methode = méthode, hote:port, auth, name, pass $mail->IsSMTP(); $mail->Host=$param[1]; if ($param[2]) { $mail->SMTPAuth=true ; $mail->Username=$param[3] ; $mail->Password=$param[4] ; if ($param[5]) $mail->SMTPSecure = $param[5]; // pour traitement connexion SSL } break ; default: case 'php': $mail->IsMail(); $to_nom=""; break; } if ($pmb_mail_html_format) $mail->IsHTML(true); $mail->From=$from_mail; $mail->FromName=$from_name; for ($i=0; $iAddAddress($destinataires[$i], $to_nom); } for ($i=0; $iAddCC($destinataires_CC[$i]); } for ($i=0; $iAddBCC($destinataires_BCC[$i]); } $mail->AddReplyTo($from_mail, $from_name); $mail->Subject=$obj; if ($pmb_mail_html_format) { if ($faire_nl2br) $mail->Body=wordwrap(nl2br($corps),70); else $mail->Body=wordwrap($corps,70); if ($pmb_mail_html_format==2) $mail->MsgHTML($mail->Body); } else { $corps=str_replace("
",PHP_EOL."*******************************".PHP_EOL,$corps); $corps=str_replace("
",PHP_EOL."*******************************".PHP_EOL,$corps); $corps=str_replace("
",PHP_EOL,$corps); $corps=str_replace("
",PHP_EOL,$corps); $corps=str_replace(PHP_EOL.PHP_EOL.PHP_EOL,PHP_EOL.PHP_EOL,$corps); $corps=strip_tags($corps); $corps=html_entity_decode($corps,ENT_QUOTES, $charset) ; $mail->Body=wordwrap($corps,70); } for ($i=0; $iAddStringAttachment($pieces_jointes[$i]["contenu"], $pieces_jointes[$i]["nomfichier"]) ; } } if (!$mail->Send()) { $retour=false; global $error_send_mail ; $error_send_mail[] = $mail->ErrorInfo ; //echo $mail->ErrorInfo."



"; //echo $mail->Body ; } else $retour=true ; if ($param[0]=='smtp') $mail->SmtpClose(); unset($mail); return $retour ; }