Opencart 联系表:需要在主题或电子邮件正文中提供发件人电子邮件 ID

Opencart contact form: Need sender email id in subject or body of email sent

希望在通过 opencart 的默认联系页面生成的电子邮件主题或电子邮件正文中包含发件人电子邮件 ID。我试过编辑 catalog/controller/information/contact.php 文件

$mail = new Mail();

$mail->protocol = $this->config->get('config_mail_protocol');

$mail->parameter = $this->config->get('config_mail_parameter');

$mail->hostname = $this->config->get('config_smtp_host');

$mail->username = $this->config->get('config_smtp_username');

$mail->password = $this->config->get('config_smtp_password');

$mail->port = $this->config->get('config_smtp_port');

$mail->timeout = $this->config->get('config_smtp_timeout');             

$mail->setTo($this->config->get('config_email'));

$mail->setFrom($this->request->post['email']);

$mail->setSender($this->request->post['name']);

$mail->setSubject(html_entity_decode(sprintf($this->language->get('email_subject'), $this->request->post['name']), ENT_QUOTES, 'UTF-8'));

$mail->setText(strip_tags(html_entity_decode($this->request->post['enquiry'], ENT_QUOTES, 'UTF-8')));

$mail->send();

$mail->setSubject(html_entity_decode(sprintf($this->language->get('email_subject'), $this->request->post['name'], $this->request->post['email']), ENT_QUOTES, 'UTF-8'));`   

以上没有帮助。让我知道要尝试或纠正什么。

试试这个主题

$mail->setSubject(html_entity_decode(sprintf($this->language->get('email_subject'),$this->request->post['name']).', Email '.$this->request->post['email'], ENT_QUOTES, 'UTF-8')); 

或者这个主题

$mail->setSubject(html_entity_decode(sprintf($this->language->get('email_subject'),'').'From '.$this->request->post['name'].', Email '.$this->request->post['email'], ENT_QUOTES, 'UTF-8'));

或者这个 body

$mail->setHtml(html_entity_decode('Enquiry: '.$this->request->post['enquiry'].'<br/> From: '.$this->request->post['name'].'<br/> Email: '.$this->request->post['email'], ENT_QUOTES, 'UTF-8'));