From 14b86abdbeb56cdfa651f941a0bf9f9bf9a528cb Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Fri, 28 Oct 2011 12:41:20 +0000 Subject: [PATCH] Allow specifying the label of the sender email SVN:trunk[1650] --- core/email.class.inc.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/core/email.class.inc.php b/core/email.class.inc.php index 706f11975..3ef2ee9b5 100644 --- a/core/email.class.inc.php +++ b/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)