include ("../connect.php");
function show_msg($msg)
{
echo'<script language="Javascript">';
echo"alert('".$msg."')";
echo'</script>';
}
if($_REQUEST["save"]) {
$_SESSION["title"]= $_REQUEST['title'];
$_SESSION["content"]= $_REQUEST['content'];
$sql="insert into tbl_mail(Mail_Title,Mail_content) VALUES ('".$_SESSION["title"]."','".$_SESSION["content"]."',NOW())";
$result = mysql_query($sql);
$strSQL = "SELECT * FROM tbl_mailinglist";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
while($objResult = mysql_fetch_array($objQuery))
{
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 = "0875420016"; // GMAIL password
$mail->From = "[email protected]"; // "[email protected]";
//$mail->AddReplyTo = "[email protected]"; // Reply
$mail->CharSet = 'windows-874';
$mail->FromName = "Ingdoy Hotel Lampang"; // set from Name
$mail->Subject = " ".$_REQUEST['title']." ";
$mail->Body = "สวัสดีค่ะ คุณ ".$_REQUEST['content']."</b>";
$mail->AddAddress($objResult["Cus_Mail"],$objResult["Cus_Name"]); // to Address
$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 D:\Inetpub\vhosts\pattaradesign.com\ingdoy\admin\sendmailinglist.php on line 21
Fatal error: require_once() [function.require]: Failed opening required 'class.phpmailer.php' (include_path='.;./includes;./pear') in D:\Inetpub\vhosts\pattaradesign.com\ingdoy\admin\sendmailinglist.php on line 21