envoyer un mail avec phpmailer
Bonsoir,
mon besoin est d'envoyer un mail en local (depuis wampserver). ayant lu ici : http://www.developpez.net/forums/d15...on-wampserver/ qu'il était mieux d'utiliser phpmailer, je l'ai fait.
Mais :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| require "../../../_lib/class.phpmailer.php";
$mail = new PHPmailer();
$monadresse='xxx';
$mail->IsSMTP();
$mail->IsHTML(true);
$mail->Host='smtp.orange.fr:587';
$mail->SMTPAuth='true';
$mail->From=$monadresse;
$mail->AddAddress($adrmail);
$mail->AddReplyTo($monadresse);
$mail->Subject='Exemple trouvé sur DVP';
$mail->Body='Voici un exemple d\'e-mail au format Texte';
if(!$mail->Send()){ //Teste le return code de la fonction
echo $mail->ErrorInfo; //Affiche le message d'erreur (ATTENTION:voir section 7)
}
else{
echo 'Mail envoyé avec succès';
}
$mail->SmtpClose();
unset($mail);] |
J'ai aussi essayé sans SMTP. Le FAI est orange et ici : http://www.developpez.net/forums/d36...-smtp-modifie/, j'ai vu que le bon port chez orange était 587.
Dans php.ini, j'ai également mis ces informations :
Code:
1 2 3 4 5 6
| [mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = smtp.orange.fr
; http://php.net/smtp-port
smtp_port = 587 |
néanmoins, j'ai 3 messages d'erreur :
Citation:
Warning: include_once(class.smtp.php): failed to open stream: No such file or directory in C:\wamp\www\_lib\class.phpmailer.php on line 515
Citation:
Warning: include_once(): Failed opening 'class.smtp.php' for inclusion (include_path='.;C:\php\pear') in C:\wamp\www\_lib\class.phpmailer.php on line 515
Citation:
Fatal error: Class 'SMTP' not found in C:\wamp\www\_lib\class.phpmailer.php on line 583
Que faut-il faire ?