PHPMailer : Could not connect to SMTP host
Bonjour
mon hebergeur n'accepte pas l'envoi directe d'email, il demande d'envoyer des emails a travers son compte gmail
et pour çà il faut activer imap (c'est fait) et installer phpmailer(c'est fait aussi) j'ai suivi des tuto pour utiliser phpmail, mais j'arrive toujours pas à recevoir mes email :(
voici mon code
Code:
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
|
<?php
include ("./include/PHPMailer/class.phpmailer.php");
$mail = new PHPmailer();
$mail->IsSMTP();
$mail->Host='smtp.google.com';
$mail->SMTPDebug = 0;
$mail->Port = 465;
$mail->SMTPAuth = true;
$mail->Username = "redwhale.byethost15@gmail.com";
$mail->Password = "mon_mot_de_passe_gamil";
$mail->From='redwhale.byethost15@gmail.com';
$mail->AddAddress('hidrijouda@yahoo.fr');
$mail->AddReplyTo('redwhale.byethost15@gmail.com');
$mail->Subject='sujet test';
$mail->Body='texte test';
if(!$mail->Send()){
echo $mail->ErrorInfo;
}
else{
echo 'Mail sent';
}
$mail->SmtpClose();
unset($mail);
?> |
et voici l'erreur qui s'affiche
SMTP Error: Could not connect to SMTP host. SMTP Error: Could not connect to SMTP host.
quelqu'un peut il m'aider
merci d'avance