May 2021 1 78 Report
J'ai un groos probléme a mon site web : Mailer Error: SMTP Error: Could not connect to SMTP host?

voila code php :

<?php

require_once('class.phpmailer.php');

require_once('class.smtp.php');

//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

$mail = new PHPMailer();

$body = "welcome";

$mail->IsSMTP();

$mail->SMTPAuth = true; // enable SMTP authentication

$mail->SMTPSecure = "ssl"; // sets the prefix to the servier

$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server

$mail->Port = 465; // set the SMTP port for the GMAIL server

$mail->Username = "***********@gmail.com"; // GMAIL username

$mail->Password = "***********"; // GMAIL password

$mail->AddReplyTo("***********@gmail.c… ");

$mail->From = "***********@gmail.com";

$mail->FromName = "salim(S@) ";

$mail->Subject = "test de gmail PHP ";

//$mail->Body = "Hi,<br>This is the HTML BODY<br>"; //HTML Body

$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test

$mail->WordWrap = 50; // set word wrap

$mail->AddAddress("*************@gmail…

$mail->Body = "test de PHP gmail";

$mail->IsHTML(true); // send as HTML

if(!$mail->Send()) {

echo "Mailer Error: " . $mail->ErrorInfo;

} else {

echo "Message sent!";

}

?>

Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Helpful Social

Copyright © 2024 1QUIZZ.COM - All rights reserved.