Commit 6680bc96 by Scott

Merge pull request #407 from phy25/patch-4

Change from / reply-to for feedback form
parents 604746da 95185f79
...@@ -130,15 +130,18 @@ ...@@ -130,15 +130,18 @@
$mailer->From=$params['fromemail']; $mailer->From=$params['fromemail'];
$mailer->Sender=$params['fromemail']; $mailer->Sender=$params['fromemail'];
$mailer->FromName=$params['fromname']; $mailer->FromName=$params['fromname'];
$mailer->AddAddress($params['toemail'], $params['toname']); $mailer->addAddress($params['toemail'], $params['toname']);
if(!empty($params['replytoemail'])){
$mailer->addReplyTo($params['replytoemail'], $params['replytoname']);
}
$mailer->Subject=$params['subject']; $mailer->Subject=$params['subject'];
$mailer->Body=$params['body']; $mailer->Body=$params['body'];
if ($params['html']) if ($params['html'])
$mailer->IsHTML(true); $mailer->isHTML(true);
if (qa_opt('smtp_active')) { if (qa_opt('smtp_active')) {
$mailer->IsSMTP(); $mailer->isSMTP();
$mailer->Host=qa_opt('smtp_address'); $mailer->Host=qa_opt('smtp_address');
$mailer->Port=qa_opt('smtp_port'); $mailer->Port=qa_opt('smtp_port');
...@@ -162,7 +165,7 @@ ...@@ -162,7 +165,7 @@
} }
} }
$send_status = $mailer->Send(); $send_status = $mailer->send();
if(!$send_status){ if(!$send_status){
@error_log('PHP Question2Answer email send error: '.$mailer->ErrorInfo); @error_log('PHP Question2Answer email send error: '.$mailer->ErrorInfo);
} }
......
...@@ -89,8 +89,10 @@ ...@@ -89,8 +89,10 @@
); );
if (qa_send_email(array( if (qa_send_email(array(
'fromemail' => qa_email_validate(@$inemail) ? $inemail : qa_opt('from_email'), 'fromemail' => qa_opt('from_email'),
'fromname' => $inname, 'fromname' => $inname,
'replytoemail' => qa_email_validate(@$inemail) ? $inemail : null,
'replytoname' => $inname,
'toemail' => qa_opt('feedback_email'), 'toemail' => qa_opt('feedback_email'),
'toname' => qa_opt('site_title'), 'toname' => qa_opt('site_title'),
'subject' => qa_lang_sub('emails/feedback_subject', qa_opt('site_title')), 'subject' => qa_lang_sub('emails/feedback_subject', qa_opt('site_title')),
...@@ -182,4 +184,4 @@ ...@@ -182,4 +184,4 @@
/* /*
Omit PHP closing tag to help avoid accidental output Omit PHP closing tag to help avoid accidental output
*/ */
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment