<?
require_once('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->AddReplyTo = "[email protected]"; // Reply
$mail->FromName = "Mr.Panupong chuchuaysuwan"; // set from Name
$mail->Subject = "Test sending mail.";
$mail->Body = "My Body & <b>My Description</b>";
$mail->AddAddress("[email protected]", "Mr.Adisorn Boonsong"); // to Address
//$mail->AddAttachment("thaicreate/myfile.zip");
//$mail->AddAttachment("thaicreate/myfile2.zip");
//$mail->AddCC("[email protected]", "Mr.Member ShotDev"); //CC
//$mail->AddBCC("[email protected]", "Mr.Member ShotDev"); //CC
$mail->set('X-Priority', '1'); //Priority 1 = High, 3 = Normal, 5 = low
$mail->Send();
?>
มันขึ้นเออเร่อแบบนี้
Warning: require_once(class.phpmailer.php) [function.require-once]: failed to open stream: No such file or directory in C:\AppServ\www\ReservTable\testmail.php on line 3
Fatal error: require_once() [function.require]: Failed opening required 'class.phpmailer.php' (include_path='.;C:\php5\pear') in C:\AppServ\www\ReservTable\testmail.php on line 3