ExecSQL($sql); $count = $result->fetchNum(); if($count == 1){ $record = $result->fetchRow(); $xsubject_name= stripslashes($record['xsubject']); $to_xmailsubject = stripslashes($record['xmailsubject']); $to_xmail = stripslashes($record['xmail']); } $xmodifydate = date('Y-m-d H:i:s'); $xcredate = date('Y-m-d H:i:s'); $sql = "insert into ".$table_contact." set xstatus = 'no', xsubjectname = '".$xsubject_name."', xsubjectmail = '".$to_xmail."', xname = '".$xname."', xtel = '".$xtel."', xmail = '".$xmail."', xmessage = '".$xmessage."', xmodifydate = '".$xmodifydate."', xcredate = '".$xcredate."'"; $result->ExecSQL($sql); $sql = "select * from ".$table_mailset." where pid = '1'"; $result->ExecSQL($sql); $count = $result->fetchNum(); if($count == 1){ $record = $result->fetchRow(); $xserver = stripslashes($record['xserver']); $xport = stripslashes($record['xport']); $xusername = stripslashes($record['xusername']); $xpassword = stripslashes($record['xpassword']); $xfrom = stripslashes($record['xfrom']); $xfromname = stripslashes($record['xfromname']); } $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = $xserver; $mail->Port = $xport; //$mail->SMTPSecure = "ssl"; // Gmail的SMTP主機需要使用SSL連線 $mail->SMTPAuth = true; $mail->Username = $xusername; $mail->Password = $xpassword; $mail->From = $xfrom; $mail->FromName = $xfromname; $mail->IsHTML(true); $mail->CharSet="utf-8"; ob_start(); $mails = split(",", $to_xmail); $mailcount = count($mails); for($i=0;$i<$mailcount;$i++) { $mail->AddAddress($mails[$i]); } include("contact_mail.php"); $mail->Subject= $to_xmailsubject; $mail->Body=ob_get_contents(); ob_end_clean(); if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; exit; } ?> Error Code!!'; } }else{ $xname="姓名 *"; $xtel ="電話"; $xsubject =0; $xmail ="E-Mail *"; $xmessage="內容 *"; } ?> FYE - 為了地球 | 從鞋子開始就是從文明開始 |