1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
include "phpmailer/class.phpmailer.php";
$mail = new PHPmailer();
$mail->IsSMTP();
//$mail->SetLanguage("en","C:/Program Files/xampp/php/PEAR/phpmailer/language");
//$mail->Host='host_smtp';
$mail->From='oliviersainteve@wanadoo.fr';
$mail->AddAddress('olivier57b@yahoo.fr');
//$mail->AddReplyTo('oliviersainteve@wanadoo.fr');
$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); |
Partager