Przeglądaj źródła

Allow specifying the label of the sender email

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1650 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 13 lat temu
rodzic
commit
89d119e8f7
1 zmienionych plików z 11 dodań i 2 usunięć
  1. 11 2
      core/email.class.inc.php

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

@@ -145,6 +145,8 @@ class EMail
 	public function SetMessageId($sId)
 	{
 		// Note: Swift will add the angle brackets for you
+		// so let's remove the angle brackets if present, for historical reasons
+		$sId = str_replace(array('<', '>'), '', $sId);
 		$this->m_oMessage->SetId($sId);
 	}
 	
@@ -219,9 +221,16 @@ class EMail
 		$this->AddToHeader('Bcc', $sAddress);
 	}
 
-	public function SetRecipientFrom($sAddress)
+	public function SetRecipientFrom($sAddress, $sLabel = '')
 	{
-		$this->m_oMessage->setFrom($sAddress);
+		if ($sLabel != '')
+		{
+			$this->m_oMessage->setFrom(array($sAddress => $sLabel));		
+		}
+		else
+		{
+			$this->m_oMessage->setFrom($sAddress);
+		}
 	}
 
 	public function SetRecipientReplyTo($sAddress)