Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1564 from phproberto/replyto

sendMail automatically adds sender as replyTo
  • Loading branch information...
commit 252cf7d1f11d046db02f2a233cfcbce0f8ffe90e 2 parents 8d51301 + bfd2875
@pasamio pasamio authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 libraries/joomla/mail/mail.php
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();
}
Please sign in to comment.
Something went wrong with that request. Please try again.