소스 검색

Allow to override some default headers when sending an email

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1632 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 13 년 전
부모
커밋
d6ac513eb7
1개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 8 2
      core/email.class.inc.php

+ 8 - 2
core/email.class.inc.php

@@ -73,8 +73,14 @@ class EMail
 	{
 		$sHeaders  = 'MIME-Version: 1.0' . "\r\n";
 		// ! the case is important for MS-Outlook
-		$sHeaders .= 'Content-Type: text/html; charset=UTF-8' . "\r\n";
-		$sHeaders .= 'Content-Transfer-Encoding: 8bit' . "\r\n";
+		if (!array_key_exists('Content-Type', $this->m_aHeaders))
+		{
+			$sHeaders .= 'Content-Type: text/html; charset=UTF-8' . "\r\n";
+		}
+		if (!array_key_exists('Content-Transfer-Encoding', $this->m_aHeaders))
+		{
+			$sHeaders .= 'Content-Transfer-Encoding: 8bit' . "\r\n";
+		}
 		foreach ($this->m_aHeaders as $sKey => $sValue)
 		{
 			$sHeaders .= "$sKey: $sValue\r\n";