probleme php mailer
Posté : 04 juin 2011, 21:26
Bonjour a tous
En quelques mots voici mon problème
J'utilise php pour envoyé un mail dans un script mais je suis hébergé chez OVH et mon mail arrive aléatoirement 5 minutes a 3h00 après.
Pour être sur de recevoir mon mail dans les temps je souhaite utilisé la class php mailer que j'ai télécharger et mise sur mon serveur
Malheureusement je ne sais pas par ou commencer pour la transformation de mon script
Pouvez vous m'aider
j'ai l'erreur : Mailer Error: Language string failed to load: provide_address
En quelques mots voici mon problème
J'utilise php pour envoyé un mail dans un script mais je suis hébergé chez OVH et mon mail arrive aléatoirement 5 minutes a 3h00 après.
Pour être sur de recevoir mon mail dans les temps je souhaite utilisé la class php mailer que j'ai télécharger et mise sur mon serveur
Malheureusement je ne sais pas par ou commencer pour la transformation de mon script
Pouvez vous m'aider
j'ai l'erreur : Mailer Error: Language string failed to load: provide_address
<?php
require_once('phpmailer/class.phpmailer.php');
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = ("smtp.xxx.fr");
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPKeepAlive = true; // SMTP connection will not close after each email sent
$mail->Host = ("[email protected]"); // sets the SMTP server
$mail->Port = 587; // set the SMTP port for the GMAIL server
$mail->Username = ("[email protected]"); // SMTP account username
$mail->Password = ("xxx"); // SMTP account password
$user = "xxx";
$password = "xxx";
$database = "xxx";
$host = "xxx";
$connect = mysql_connect($host, $user, $password) or die(mysql_error());
mysql_select_db($database);
$forcli = $Cookcli;
$result = mysql_query ("select * from client where codecli = '$forcli'");
$row = mysql_fetch_object($result);
echo "<FONT SIZE=+3>";
echo "<DIV ALIGN=center><FONT COLOR=\"#0000CC\"><B>$forcli $row->nom</B></FONT></DIV>";
echo "</FONT>";
echo "<HR SIZE=3 NOSHADE>";
$forcli = $Cookcli;
$fornom = $Cooknom;
if ($forcli < 1)
{echo "<B><FONT SIZE=+1>Votre session est terminée, vous devez vous identifier à nouveau...</FONT></B>";}
$fordate = gmdate("Y-m-d");
$nb = 1;
if ($forcli < 1) {$nb = 0;}
$result = mysql_query("select * from bordereau left join dossier on dossier.numdos = bordereau.numdos where bordereau.numbor = '$numbor' and bordereau.etat = 1
order by bordereau.numbor, bordereau.numdos ");
$nb2 = 0;
if ($result) {$nb2 = mysql_num_rows($result);}
if ($nb2 == 0) {$nb = 0;}
if ($nb > 0)
{while ($row = mysql_fetch_object($result))
{
$si = " numbor = $row->numbor and numdos = $row->numdos ";
$majbor = mysql_query
("update bordereau set etat = 2 where ".$si);
$mesbor .= "$forcli $row->typetrans $fornom;$row->numdos;";
$mesbor .= "$row->reference;$row->nom;$row->adresse1;$row->adresse2;";
$mesbor .= "$row->codepostal;$row->ville;$row->codepays;";
$mesbor .= "$row->nbcolis;$row->poids;$row->volume;$row->metreplancher;";
$mesbor .= "$row->portdu;$row->cr;$row->crdevise;";
$mesbor .= "$row->cr2;$row->crdev2;";
$mesbor .= "$row->vd;$row->vddevise;$row->commentaire;";
$mesbor .= "$row->express;$row->hayon;$row->teldesti;";
$mesbor .= "$row->nbpalettes;$row->obspalette;\n";
}
;}
$mesbor = strtoupper($mesbor);
$ligne1 = "<br>";
$ligne2 = "<br>le bordereau numéro <B>$numbor</B> est transmis";
if ($nb > 0) {echo "$ligne1 $ligne2";
$mail-> $recip = ("[email protected]");
$mail-> $reply = ("[email protected]");
$mail-> $objet = ("Bordereau de chargement N $numbor");
$mail-> $message = ("$mesbor");
$mail-> $headers .= ("From: $fornom $forcli <[email protected]>\n");
$mail-> $headers .= ("X-priority: 1\n");
$mail-> $headers .= ("Content-type: text/plain; charset=iso-8859-1\n");
$mail-> $headers .= ("Content-Transfert-Encoding: 7bit\n");
$mail-> $nomfich = ("BO$numbor.txt");
$mail-> $headers .= ("Content-Disposition: attachment; filename=$nomfich\n");
}
if(!$mail->Send($recip, $objet, $message, $headers)) {
echo "Mailer Error: " . $mail->ErrorInfo;
}else {
echo "Message sent!";
}
if ($nb >0)
{echo "<BR><BR><DIV ALIGN=\"center\">
<A HREF=\"borimp.php? numbor=$numbor\" TARGET=_blank>Imprimer le bordereau</A>
<A HREF=\"bordefinitif.php\" TARGET=_self>Retour</A>
</DIV>" ;}
?>