Bonsoir,

je viens de changer d'hébergeur (donc de version de PHP) et le code que j'utilise pour PHPMAILER semble incompatible ; est-il possible de m'en proposer un qui soit compatible ?

Code php : 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
<?php 
header('Content-type: text/html; charset=UTF-8'); 
error_reporting(E_ALL); 
ini_set('display_errors','1'); 
 
require_once "class.phpmailer.php"; 
$mail = new PHPmailer(); 
//$mail->IsHTML(true); 
 
$mail->setLanguage('en','language/phpmailer.lang-en.php'); 
//$mail->SMTPDebug = 2; 
$mail->IsSMTP(); 
$mail->Host='mail.vercorshandisport.org'; 
$mail->AddAddress('mon_adresse@aol.com'); 
$mail->AddReplyTo('mon_adresse@aol.com'); 
$mail->Subject='Exemple trouvé sur DVP'; 
$mail->Body='<html><body><head><style>.entete{background-color:#0000FF;color:#FFFFFF;border:solid 3px;font-size:25px}'; 
$mail->Body.='.ligne{color:#0000FF;border:solid 1px;text-align:center;font-size:23px}</style></head>'; 
$mail->Body.='<center><table><tr><td class="entete">Voici un exemple d\\'e-mail au format HTML</td></tr>'; 
$mail->Body.='<tr><td class="ligne">Ceci est un tableau HTML</td></tr></table></center></body></html>'; 
if(!$mail->Send()){ //Teste si le return code est ok. 
echo $mail->ErrorInfo; //Affiche le message d'erreur (ATTENTION:voir section 7) 
} 
else{ 
 echo 'Mail envoyé avec succès'; 
 } 
 
unset($mail); 
 
?>