Bonjour,

J'ai un petit probleme, je parcour un fichier excel et à ca que ligne j'exécute le code suivant (campagne mailing) :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
 
$tab_num = array("{/}","{1}", "{2}");
$tab_ref = array("<br />",blabla, blabla);
 
$mail = str_replace($tab_num, $tab_ref, $_POST["zt_mail"]);
 
$newcorp = str_replace($tab_num, $tab_ref, stripslashes($_POST["zt_corp"]));
 
 
$objet = stripslashes($_POST["zt_sujet"]);
$corp_texte = stripslashes($newcorp);
$corp_mail_html=htmlentities(stripslashes($newcorp),ENT_QUOTES,'UTF-8');
 
 
$mailer = new PHPmailer();
$mailer->SetLanguage('fr','phpmailer/language/');
$mailer->IsSMTP();
$mailer->isHTML(true);
$mailer->ContentType = "text/html";
$mailer->Encoding = "8bit";
$mailer->Host='host.fr';
$mailer->Port=26;
$mailer->SMTPAuth = true;
$mailer->Username="user";
$mailer->Password="pswd";
$mailer->From=$_POST["zt_adr_exp"];
//$mailer->From=$_POST["zt_adr_exp"];
$mailer->FromName=$_POST["zt_lib_exp"];
$mailer->AddAddress($mail);
$mailer->AddReplyTo($_POST["zt_adr_exp"]);
$mailer->Subject=$objet;
$mailer->Body="<html><head><meta http-equiv='content-type' content='text/html; charset=utf-8' /><style>body{font-family: 'Segoe UI';}</style></head><body>".$corp_mail_html."<br><br />ijjijom</body></html>";
$mailer->altBody =$corp_texte."format texte";
 
	if(!$mailer->Send()){ //Teste le return code de la fonction
			  echo $mailer->ErrorInfo; //Affiche le message d'erreur (ATTENTION:voir section 7)
			 echo "<br> - </br>";
		 $cpt_erreur++;
			}
			else{	  
			  echo 'Mail envoyé avec succès';
			   echo "<br> - </br>";
 
 
			}
Le probleme est que sur par exemple 20 mail, ils vont tous etre envoyé mais une dizaine seront des mails vide.... on dirait que à certains moment le corp n'a pas le temps de se regenerer

Qu'en pensez vous svp merci beaucoup par avance