Subversion Repositories php-qbpwcf

Rev

Rev 48 | Rev 226 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 48 Rev 58
Line 2323... Line 2323...
2323
	#回傳結果:
2323
	#回傳結果:
2324
	#$result["status"],執行正常與否,"true"代表正常;反之為"false".
2324
	#$result["status"],執行正常與否,"true"代表正常;反之為"false".
2325
	#$result["error"],錯誤訊息陣列
2325
	#$result["error"],錯誤訊息陣列
2326
	#$result["function"],當前執行的函數.
2326
	#$result["function"],當前執行的函數.
2327
	#必填參數:
2327
	#必填參數:
2328
	$conf["mailServer"],字串,要使用的SMTP郵件伺服器網址.若為tls加密,開頭請輸入"ssl://".
2328
	#$conf["mailServer"],字串,要使用的SMTP郵件伺服器網址.若為tls加密,開頭請輸入"ssl://".
2329
	$conf["mailServer"]="";
2329
	$conf["mailServer"]="";
2330
	#$conf["username"],字串,用來登入郵件伺服器的帳號
2330
	#$conf["username"],字串,用來登入郵件伺服器的帳號
2331
	$conf["username"]="";
2331
	$conf["username"]="";
2332
	#$conf["password"],字串,用來登入郵件伺服器的密碼
2332
	#$conf["password"],字串,用來登入郵件伺服器的密碼
2333
	$conf["password"]="";
2333
	$conf["password"]="";
Line 2344... Line 2344...
2344
	#$conf["mailServerPort"]=465;
2344
	#$conf["mailServerPort"]=465;
2345
	#$conf["mailerMailDisplay"],字串,要顯示的寄件人信箱,預設爲 $conf["username"]
2345
	#$conf["mailerMailDisplay"],字串,要顯示的寄件人信箱,預設爲 $conf["username"]
2346
	#$conf["mailerMailDisplay"]="";
2346
	#$conf["mailerMailDisplay"]="";
2347
	#$conf["mailerNameDisplay"],字串,要顯示的寄件人姓名,預設爲 $conf["username"]
2347
	#$conf["mailerNameDisplay"],字串,要顯示的寄件人姓名,預設爲 $conf["username"]
2348
	#$conf["mailerNameDisplay"]="";
2348
	#$conf["mailerNameDisplay"]="";
2349
	#$conf["receiverMailDisplay"],陣列,要顯示的收件人信箱,預設爲 $conf["receiverMail"] 對應的元素.
-
 
2350
	#$conf["receiverMailDisplay"]="";#
-
 
2351
	#$conf["receiverNameDisplay"],陣列,要顯示的收件人姓名,預設爲 $conf["receiverMail"] 對應的元素.
2349
	#$conf["receiverNameDisplay"],陣列,要顯示的收件人姓名,預設爲 $conf["receiverMail"] 對應的元素.
2352
	#$conf["receiverNameDisplay"]="";
2350
	#$conf["receiverNameDisplay"]=array();
2353
	#$conf["attachment"],陣列,每個要寄送的附件路徑與檔案名稱
2351
	#$conf["attachment"],陣列,每個要寄送的附件路徑與檔案名稱
2354
	#$conf["attachment"]=array();
2352
	#$conf["attachment"]=array();
2355
	#$conf["attachmentName"],陣列,每個要寄送的附件顯示名稱,預設為$conf["attachment"]中的實際檔案名稱.
2353
	#$conf["attachmentName"],陣列,每個要寄送的附件顯示名稱,預設為$conf["attachment"]中的實際檔案名稱.
2356
	#$conf["attachmentName"]=array();
2354
	#$conf["attachmentName"]=array();
2357
	#$conf["attachmentMimeType"],陣列,每個附件的 mimeType,預設為"application/*".
2355
	#$conf["attachmentMimeType"],陣列,每個附件的 mimeType,預設為"application/*".
Line 2553... Line 2551...
2553
			#回傳結果
2551
			#回傳結果
2554
			return $result;
2552
			return $result;
2555
			
2553
			
2556
			}#if end
2554
			}#if end
2557
			
2555
			
2558
		#如果套件不存在
2556
		#如果不存在
2559
		if($checkMultiFileExist["allExist"]==="false"){
2557
		if($checkMultiFileExist["allExist"]==="false"){
2560
			
2558
			
2561
			#設置錯誤識別
2559
			#設置錯誤識別
2562
			$result["status"]="false";
2560
			$result["status"]="false";
2563
			
2561
			
Line 2906... Line 2904...
2906
					$conf["fileAccess::getFileAddressAndNameAndFileExtention"]["fileAddressAndName"]=$conf["attachment"][$i];
2904
					$conf["fileAccess::getFileAddressAndNameAndFileExtention"]["fileAddressAndName"]=$conf["attachment"][$i];
2907
					#可省略的參數:
2905
					#可省略的參數:
2908
					#無.
2906
					#無.
2909
					$getFileAddressAndNameAndFileExtention=fileAccess::getFileAddressAndNameAndFileExtention($conf["fileAccess::getFileAddressAndNameAndFileExtention"]);
2907
					$getFileAddressAndNameAndFileExtention=fileAccess::getFileAddressAndNameAndFileExtention($conf["fileAccess::getFileAddressAndNameAndFileExtention"]);
2910
					unset($conf["fileAccess::getFileAddressAndNameAndFileExtention"]);
2908
					unset($conf["fileAccess::getFileAddressAndNameAndFileExtention"]);
2911
							
2909
					
2912
					#如果解析檔案資訊失敗
2910
					#如果解析檔案資訊失敗
2913
					if($getFileAddressAndNameAndFileExtention["status"]==="false"){
2911
					if($getFileAddressAndNameAndFileExtention["status"]==="false"){
2914
						
2912
						
2915
						#設置錯誤識別
2913
						#設置錯誤識別
2916
						$result["status"]="false";
2914
						$result["status"]="false";
Line 2992... Line 2990...
2992
				$attachment=$attachment."X-Attachment-Id: f_io1ikfii".$i."\r\n";
2990
				$attachment=$attachment."X-Attachment-Id: f_io1ikfii".$i."\r\n";
2993
				
2991
				
2994
				#將檔案用base64加密
2992
				#將檔案用base64加密
2995
				$base64fileStr=base64_encode(file_get_contents($conf["attachment"][$i]));
2993
				$base64fileStr=base64_encode(file_get_contents($conf["attachment"][$i]));
2996
				
2994
				
2997
				#依據規定,每列不得大於70的字元
-
 
2998
				#$wordwrapedFileStr=wordwrap($base64fileStr,70,"\r\n",true);
-
 
2999
				
-
 
3000
				#斷行後附加檔案字串
-
 
3001
				#$attachment=$attachment."\r\n".$wordwrapedFileStr."\r\n";	
-
 
3002
				
-
 
3003
				#斷行後附加檔案字串
2995
				#斷行後附加檔案字串
3004
				$attachment=$attachment."\r\n".$base64fileStr."\r\n";
2996
				$attachment=$attachment."\r\n".$base64fileStr."\r\n";
3005
				
2997
				
3006
				#如果是最後一個附件
2998
				#如果是最後一個附件
3007
				if($i===count($conf["attachment"])-1){
2999
				if($i===count($conf["attachment"])-1){
Line 3024... Line 3016...
3024
		if(isset($conf["signWithGPGid"])){
3016
		if(isset($conf["signWithGPGid"])){
3025
		
3017
		
3026
			#將原本的 Content-Type 放到 data 前面.
3018
			#將原本的 Content-Type 放到 data 前面.
3027
			$data=$contentDescInHead.$data;
3019
			$data=$contentDescInHead.$data;
3028
		
3020
		
-
 
3021
			#sign之前的內容,要先符合每列不得大於70的字元的規定
-
 
3022
			$data=wordwrap($data,70,"\r\n",true);
-
 
3023
		
3029
			#用gpg指令簽署body
3024
			#用gpg指令簽署body
3030
			#函式說明:
3025
			#函式說明:
3031
			#呼叫shell執行系統命令,並取得回傳的內容.
3026
			#呼叫shell執行系統命令,並取得回傳的內容.
3032
			#回傳結果:
3027
			#回傳結果:
3033
			#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
3028
			#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.