Comment envoyer un e-mail à partir de localhost avec phpmailer?

ok, donc j'ai déjà essayer plusieurs fois. Les résultats n'était pas d'erreur mais je n'ai pas reçu d'e-mail dans ma boîte de réception ou dans le dossier spam de

voici mon mail.php

    <?php


require 'phpmailer/PHPMailerAutoload.php';

$mail = new PHPMailer();
//$mail->IsSMTP(); //telling the class to use SMTP
//$mail->Host = "localhost"; //SMTP server
//IsSMTP(); //send via SMTP
$mail->SMTPDebug = true;
$mail->IsSMTP();
$mail->Host     = "smtp.gmail.com"; //SMTP server Gmail
$mail->Mailer   = "gmail";
$mail->SMTPAuth = true; //turn on SMTP authentication
$mail->SMTPSecure = 'tls'; 
$mail->Port = 587;   


$mail->Username = "[email protected]"; //
$mail->Password = "******"; //SMTP password
$webmaster_email = "[email protected]"; //Reply to this email ID
$email = "[email protected]"; //Recipients email ID
$name = "Hendrikus Anthony"; //Recipient's name
$mail->From = $webmaster_email;
$mail->FromName = "Anthony";
$mail->AddAddress($email,$name);
$mail->AddReplyTo($webmaster_email,"Anthony");
$mail->WordWrap = 50; //set word wrap

$mail->IsHTML(true); //send as HTML
$mail->Subject = "Ini adalah Email HTML";
$mail->Body = "Ini adalah email contoh"; //HTML Body
$mail->AltBody = "This is the body when user views in plain text format"; //Text Body 
if(!$mail->Send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "Message has been sent";
}
?>

il vous plaît quelqu'un, j'ai vraiment besoin d'aide. ai-je besoin d'un hébergement? ou il ya quelque chose de mal avec ma syntaxe? si sendmail.ini et php.ini affecter la mail.php?

  • Aucune réponse utiliser "localhost" merci de modifier le titre de la question.