mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
Enhancement of the Email class to preserve backward compatibility...
SVN:trunk[2141]
This commit is contained in:
@@ -138,7 +138,27 @@ class EMail
|
||||
if (strlen($sValue) > 0)
|
||||
{
|
||||
$oHeaders = $this->m_oMessage->getHeaders();
|
||||
$oHeaders->addTextHeader($sKey, $sValue);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user