Проблему решил путем внесения изменений в contact.php и mail.php: http://www.expertsos.net/blog/opencart-fixing-notice-error-rcpt-to-not-accepted-from-server/
Позволю сделать копирайт решения: Opencart 1.5 FixFirst edit the file catalog/controller/information/contact.phpLook for line:
$mail->setFrom($this->request->post['email']);
in my version it is line 20
Change it to:
$mail->setFrom($this->config->get('config_email'));
What this will do is set the FROM field to be the same as your shop’s main email address.
You can hardcode (but I wouldn’t recommend it) an email adress here if you want by changing this line to ie:
$mail->setFrom('moc.niamodym@pohs');
Now find the line:$mail->setSender($this->request->post['name']);
It should be below the line we just edited or somwhere near.
Change it to:
$mail->setReplyTo($this->request->post['email']);
$mail->setSender($this->config->get('config_email'));
What this will do is set your client’s email provided by him in the contact form as reply-to email, so that you’re able to respond automatically to contact form messages by clicking on Reply button.
It is also setting your shop email address as sender’s name.
OK so now we need to edit system/library/mail.php fileIn the beginning you will have line:
protected $subject;
Just add this before it:
protected $replyto;
Find line:public function setSender($sender) {
and before it add:
public function setReplyTo($reply_to) {
$this->replyto = html_entity_decode($reply_to, ENT_QUOTES, 'UTF-8');
}
What we did here is to add REPLY-TO function which is missing in 1.5 (but is present in 2.0) and allows us to set different reply-to addresses than FROM address.
Finally find this line:$header .= 'Reply-To: ' . '=?UTF-8?B?' . base64_encode($this->sender) . '?=' . ' <' . $this->from . '>' . $this->newline;
and change it to:
$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->replyto) . '?=' . ' <' . $this->replyto . '>' . $this->newline;
Here we are correcting the way reply-to address is set (it will use the email address your client introduced in the contact form).
And that’s it!
Opencart 2.0 fixIt is simplier to change in the newest version of OC because there is already a funciton to set Reply-To address.
First edit the file catalog/controller/information/contact.phpLook for line:
$mail->setFrom($this->request->post['email']);
in my version it is line 20
Change it to:
$mail->setFrom($this->config->get('config_email'));
What this will do is set the FROM field to be the same as your shop’s main email address.
You can hardcode (but I wouldn’t recommend it) an email adress here if you want by changing this line to ie:
$mail->setFrom('moc.niamodym@pohs');
Now find this line:$mail->setSender($this->request->post['name']);
It should be below the line we just edited or somwhere around.
Change it to:
$mail->setReplyTo($this->request->post['email']);
$mail->setSender($this->config->get('config_email'));
What this will do is set your client’s email provided by him in the contact form as reply-to email, so that you’re able to respond automatically to contact form messages by clicking on Reply button.
It is also setting your shop email address as sender’s name.
No we need to edit system/library/mail.php fileYou just need to change one line:
$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->replyto) . '?=' . ' <' . $this->from . '>' . $this->newline;
change it to:
$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->replyto) . '?=' . ' <' . $this->replyto . '>' . $this->newline;
Here we are correcting the way reply-to address is set (it will use the email address your client introduced in the contact form).
Refresh your contact form and try sending a test email.