<?php
require_once('PHPMailer_v5.1/class.phpmailer.php');
$mail = new PHPMailer();
$mail->IsHTML(true);
$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 = "[email protected]"; // GMAIL username
$mail->Password = "**********"; // GMAIL password
$mail->From = "[email protected]"; // "[email protected]";
$mail->FromName = "Nan"; // set from Name
$mail->Subject = "Engineer"; //หัวเรื่อง
$mail->Body = " test test teste teste sttestetstetstetstetetstestset";
$mail->AddAddress("[email protected]"); // to Address
$mail->Send();
?>
ผมลัพธ์
SMTP Error: Could not authenticate.
Tag : PHP, MySQL, HTML/CSS, JavaScript, Ajax, jQuery