Fixed a regression introduced by [r3242] (warning when sending an email with an empty "To")

SVN:trunk[3265]
This commit is contained in:
Denis Flaven
2014-07-11 13:27:13 +00:00
parent 02ee41ef09
commit 880653f191
2 changed files with 7 additions and 4 deletions

View File

@@ -184,10 +184,13 @@ class EMail
$oMailer = Swift_Mailer::newInstance($oTransport);
$iSent = $oMailer->send($this->m_oMessage);
$aFailedRecipients = array();
$iSent = $oMailer->send($this->m_oMessage, $aFailedRecipients);
if ($iSent === 0)
{
$aIssues = array('No valid recipient for this message.');
// Beware: it seems that $aFailedRecipients sometimes contains the recipients that actually received the message !!!
IssueLog::Warning('Email sending failed: Some recipients were invalid, aFailedRecipients contains: '.implode(', ', $aFailedRecipients));
$aIssues = array('Some recipients were invalid.');
return EMAIL_SEND_ERROR;
}
else
@@ -321,7 +324,7 @@ class EMail
public function GetRecipientTO($bAsString = false)
{
$aRes = $this->m_oMessage->getTo();
if ($aRes === false)
if ($aRes === null)
{
// There is no "To" header field
$aRes = array();