include('PHPMailer_5.2.4/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 = "dreammiiz";
// set from Name
$mail->Subject = "สวัสดีครับ ทดสอบการส่งเมล์ครับ";
$mail->Body = 'ทดสอบการส่งเมล์ครับ body ครับ';
$mail->AddAddress('
[email protected]');
// to Address
$mail->set('X-Priority', '1');
//Priority 1 = High, 3 = Normal, 5 = low
if(!$mail->Send())
{
echo 'Mailer Error: ' . $mail->ErrorInfo.'<br />';
}
else
{
echo 'Message has been sent<br />';
}