SMTP -> ERREUR: Échec de la connexion au serveur: la connexion refusée (111) SMTP Connect () a échoué.
<?php
include "emails/PHPMailer/PHPMailerAutoload.php";
//or just include the phpMailer
//Create a new PHPMailer instance
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug = 1;
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'ssl';
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
$mail->IsHTML(true);
//Username to use for SMTP authentication
$mail->Username = "@gmail.com";
$mail->Password = "";
//Set who the message is to be sent from
$mail->setFrom('[email protected]', 'Zubair Mushtaq');
//Set an alternative reply-to address
$mail->addReplyTo('[email protected]', 'Secure Developer');
//Set who the message is to be sent to
$mail->addAddress('[email protected]', 'Abulogicss');
//Set the subject line
$mail->Subject = 'PHPMailer SMTP test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML("convert HTML into a basic plain-text alternative body");
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
uzii