You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.1 KiB
45 lines
1.1 KiB
<?php
|
|
/**
|
|
* 線上諮詢
|
|
*/
|
|
date_default_timezone_set("Asia/Taipei");
|
|
require_once('../../conf/ParametersException.php');
|
|
require_once('../../../securimage/securimage.php');
|
|
require_once('../../class/SendMail.php');
|
|
|
|
try{
|
|
$returnStr = '';
|
|
$result = array();
|
|
$sendMail = new SendMail();
|
|
$returnArr = array();;
|
|
$nowDatetime = date("Y-m-d H:i:s");
|
|
|
|
if ( !isset($_POST) || !is_array($_POST) || count($_POST) <= 0 ){
|
|
throw new ParametersException('無傳入資料');
|
|
}
|
|
$securimage = new Securimage();
|
|
if ( $securimage->check($_POST['verify']) == false ){
|
|
throw new ParametersException("驗證碼錯誤", 1);
|
|
}
|
|
|
|
|
|
$dataArr = $_POST;
|
|
|
|
$mailHtml = $sendMail->getEstimateMailContent( $dataArr );
|
|
$sendResult = $sendMail->sendMail($sendMail->getReceiver(), '線上諮詢表單通知信', $mailHtml);
|
|
http_response_code(200);
|
|
|
|
} catch ( ParametersException $pe ){
|
|
http_response_code(400);
|
|
$returnStr = $pe->getMessage();
|
|
|
|
} catch ( Exception $e ){
|
|
http_response_code(500);
|
|
$returnStr = '系統錯誤';
|
|
$returnStr = $e->getMessage();
|
|
} finally {
|
|
echo $returnStr;
|
|
}
|
|
|
|
|
|
?>
|