mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Support multiple recipients in To: Cc: and Bcc:
SVN:trunk[2487]
This commit is contained in:
@@ -141,22 +141,6 @@ class EMail
|
||||
$oHeaders = $this->m_oMessage->getHeaders();
|
||||
switch(strtolower($sKey))
|
||||
{
|
||||
case 'from':
|
||||
case 'cc':
|
||||
case 'bcc':
|
||||
$aMatches = array();
|
||||
// Header may be in the form: John Doe <jd@company.com>
|
||||
if (preg_match('/^([^<]+) <([^>]+)>$/', $sValue, $aMatches))
|
||||
{
|
||||
$aHeader = array($aMatches[2] => $aMatches[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$aHeader = array($sValue);
|
||||
}
|
||||
$oHeaders->addMailboxHeader($sKey, $aHeader);
|
||||
break;
|
||||
|
||||
default:
|
||||
$oHeaders->addTextHeader($sKey, $sValue);
|
||||
}
|
||||
@@ -205,7 +189,8 @@ class EMail
|
||||
|
||||
public function SetRecipientTO($sAddress)
|
||||
{
|
||||
$this->m_oMessage->setTo($sAddress);
|
||||
$aAddresses = explode(', ', $sAddress);
|
||||
$this->m_oMessage->setTo($aAddresses);
|
||||
}
|
||||
|
||||
public function GetRecipientTO($bAsString = false)
|
||||
@@ -236,12 +221,14 @@ class EMail
|
||||
|
||||
public function SetRecipientCC($sAddress)
|
||||
{
|
||||
$this->AddToHeader('Cc', $sAddress);
|
||||
$aAddresses = explode(', ', $sAddress);
|
||||
$this->m_oMessage->setCc($aAddresses);
|
||||
}
|
||||
|
||||
public function SetRecipientBCC($sAddress)
|
||||
{
|
||||
$this->AddToHeader('Bcc', $sAddress);
|
||||
$aAddresses = explode(', ', $sAddress);
|
||||
$this->m_oMessage->setBcc($aAddresses);
|
||||
}
|
||||
|
||||
public function SetRecipientFrom($sAddress, $sLabel = '')
|
||||
@@ -258,7 +245,7 @@ class EMail
|
||||
|
||||
public function SetRecipientReplyTo($sAddress)
|
||||
{
|
||||
$this->AddToHeader('Reply-To', $sAddress);
|
||||
$this->m_oMessage->setReplyTo($sAddress);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user