sendMail automatically adds sender as replyTo #1564

Merged
merged 1 commit into from Oct 4, 2012
View
5 libraries/joomla/mail/mail.php
@@ -441,7 +441,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);
@@ -471,6 +470,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();
}