if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');
$mail->smtp_username = $this->config->get('config_mail_smtp_username');
$mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');
$mail->smtp_port = $this->config->get('config_mail_smtp_port');
$mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');
$mail->setTo($this->config->get('config_email'));
$mail->setFrom($this->config->get('config_email'));
$mail->setReplyTo($this->request->post['email']);
$mail->setSender(html_entity_decode($this->request->post['name'], ENT_QUOTES, 'UTF-8'));
$mail->setSubject(html_entity_decode(sprintf($this->language->get('email_subject'), $this->request->post['name']), ENT_QUOTES, 'UTF-8'));
//$mail->setText($this->request->post['enquiry']);
$text = "Email клиента: ".$this->request->post['email']."\n\n".$this->request->post['enquiry'];
$mail->setText($text);
// done
$mail->send();
$this->response->redirect($this->url->link('information/contact/success'));
}
Всем привет.
На данный момент письма из контактной формы не включают в себя почтовый адрес отправителя, а ставят его в reply-to и в случае перенаправления данного письма, получатель уже не сможет ответить клиенту.
Подскажите как добавить адрес в основной текст?
p.s. ну ещё можно заменить, не проверял пока.
$mail->setFrom($this->request->post['email']);
Спасибо за любой совет.