<?php
// 如果有錯誤訊息則顯示
error_reporting(E_ALL);
$timezone = "Asia/Taipei";

define("MAIL_SUBJECT", "景自慢客戶通知信");
define("MAIL_FROM", "香蕉樹留單通知系統");
//define("MAIL_FROM_MAIL", "breakgod0423@gmail.com");
//define("MAIL_FROM_ACC", "breakgod0423");
//define("MAIL_FROM_PSW", "f127breakgod0423");
define("MAIL_FROM_MAIL", "banana6938@gmail.com");
define("MAIL_FROM_ACC", "banana6938");
define("MAIL_FROM_PSW", "ubqyxbtwatbaoffc");
define("MAIL_TO", "dragondriverex@gmail.com");
require ("../includes/PHPMailer/class.phpmailer.php");



$mail= new PHPMailer();                          			//建立新物件  
$mail->IsSMTP();                                    		//設定使用SMTP方式寄信  
$mail->SMTPAuth = true;                        				//設定SMTP需要驗證  
$mail->SMTPSecure = "ssl";                    				// Gmail的SMTP主機需要使用SSL連線  
$mail->SMTPDebug =1;
$mail->Host = "smtp.gmail.com";            					//Gamil的SMTP主機  
$mail->Port = 465;                                			//Gamil的SMTP主機的埠號(Gmail為465)。  
$mail->CharSet = "utf-8";                       			//郵件編碼  
$mail->Username = MAIL_FROM_ACC; 							//Gamil帳號  
$mail->Password = MAIL_FROM_PSW; 			                //Gmail密碼  
$mail->From = MAIL_FROM_MAIL;								//件者信箱  

$mail->FromName = htmlspecialchars(MAIL_FROM);         		//寄件者姓名  
$mail->Subject = MAIL_SUBJECT;								//郵件標題  
$mail->Body = "AAA";  
$mail->IsHTML(true);                             			//郵件內容為html  

$mail->AddAddress("dragondriverex@gmail.com");          						//收件者郵件及名稱  
if(!$mail->Send()){  
echo $mail->ErrorInfo;
}else{  
echo "success";	 
}  