From 316710e6ab40ac39e6f57e68a6f724f5693d1243 Mon Sep 17 00:00:00 2001 From: Mark Dexter Date: Fri, 29 Mar 2013 16:37:12 -0700 Subject: [PATCH] [#29417] sendMail automatically adds sender as replyTo. Thanks Roberto. --- installation/CHANGELOG | 1 + libraries/joomla/mail/mail.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/installation/CHANGELOG b/installation/CHANGELOG index 960f21465964e..cd0992bcf96ce 100644 --- a/installation/CHANGELOG +++ b/installation/CHANGELOG @@ -28,6 +28,7 @@ $ -> Language fix or change 28-Mar-2013 Jean-Marie Simonet # *Multilanguage 2.5: SIngle article display does not filter correctly author contact per language. + # [#29417] sendMail automatically adds sender as replyTo. Thanks Roberto. 24-Mar-2013 Michael Babker # [#28978] Smart search (com_finder) - problem when using "Allow Empty Search". Thanks Valentin diff --git a/libraries/joomla/mail/mail.php b/libraries/joomla/mail/mail.php index 20e3862452e57..9a63857a63db2 100644 --- a/libraries/joomla/mail/mail.php +++ b/libraries/joomla/mail/mail.php @@ -417,7 +417,6 @@ public function useSMTP($auth = null, $host = null, $user = null, $pass = null, public function sendMail($from, $fromName, $recipient, $subject, $body, $mode = false, $cc = null, $bcc = null, $attachment = null, $replyTo = null, $replyToName = null) { - $this->setSender(array($from, $fromName)); $this->setSubject($subject); $this->setBody($body); @@ -447,6 +446,10 @@ public function sendMail($from, $fromName, $recipient, $subject, $body, $mode = $this->addReplyTo(array($replyTo, $replyToName)); } + // Add sender to replyTo only if no replyTo received + $autoReplyTo = (empty($this->ReplyTo)) ? true : false; + $this->setSender(array($from, $fromName, $autoReplyTo)); + return $this->Send(); }