From 3433bd658fa09f46c0329ec28ca51a8742cd460b Mon Sep 17 00:00:00 2001 From: nicoschtein Date: Wed, 20 Nov 2013 13:12:29 -0200 Subject: [PATCH] Added "Reply-To" header to email Added simple verification for cases where no sender name or email are set. --- public/include/classes/mail.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/include/classes/mail.class.php b/public/include/classes/mail.class.php index efe32ef3..af3090cd 100644 --- a/public/include/classes/mail.class.php +++ b/public/include/classes/mail.class.php @@ -62,6 +62,8 @@ class Mail extends Base { $headers = 'From: Website Administration <' . $this->setting->getValue('website_email') . ">\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; + if (strlen($aData['senderName']) > 0 && strlen($aData['senderEmail']) > 0 ) + $headers .= 'Reply-To: ' . $aData['senderName'] . ' <' . $aData['senderEmail'] . ">\n"; if (mail($aData['email'], $this->smarty->fetch(BASEPATH . 'templates/mail/subject.tpl'), $this->smarty->fetch(BASEPATH . 'templates/mail/' . $template . '.tpl'), $headers)) return true; $this->setErrorMessage($this->sqlError('E0031'));