mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Fixed a regression introduced by [r3242] (warning when sending an email with an empty "To")
SVN:trunk[3265]
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -595,7 +595,7 @@ class Swift_Mime_SimpleMimeEntity implements Swift_Mime_MimeEntity
|
||||
if ($this->_headers->has($field)) {
|
||||
return $this->_headers->get($field)->getFieldBodyModel();
|
||||
}
|
||||
return false;
|
||||
return null; // Returning null is equivalent to no return, but is easier to read!!
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user