PHPMailer to use Gmail as SMTP server.Could not connect to SMTP host. Mailer Error: SMTP Error: Could not connect to SMTP host
问题 i am trying to use phpMailer to send confirmation messages to users via email. my code is this: <?php include("class.phpmailer.php"); include("class.smtp.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // set mailer to use SMTP $mail->Host = "ssl://smtp.gmail.com"; // specify main and backup server $mail->Port = 465; // set the port to use $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = "sender@gmail.com"; // your SMTP username or your gmail username $mail->Password