0

Recently i moved my opencart shop to a new host but i found new issue in sending email by system, after user submit an order, system send a confirmation email for him and also for me (admin) successfully but user see an error:

Warning: mail(/var/log/php_mail.log): faild to open stream: Permission denied in ///system/library/mail.php on line 164

and also when i want to add a history to his order, when i check Notify Customer i see an error:

SyntaxError: Unexpected token < in JSON at position 0 OK Warning: mail(/var/log/php_mail.log): faild to open stream: Permission denied in ///system/library/mail.php on line 164

What this mean? and what's the problem?

I googled but none of results related to sending email case.

Thanks in advance

Pedram
  • 15,766
  • 10
  • 44
  • 73
  • 1
    It seems that there is some issue related to permissions. Check [Link1](https://stackoverflow.com/questions/1906403/mail-failed-to-open-stream-permission-denied) and [Link2](https://forum.opencart.com/viewtopic.php?f=20&t=112620). Or simply givewrite permissions to your whole opencart files folder. – Nimish Jun 01 '17 at 07:21
  • @Nimish Thanks, I'll try – Pedram Jun 03 '17 at 09:42

2 Answers2

0

I solved this issue. for future, if anyone face with this problem:

in e-mail setting should add e-mail with a -f at the beginning:

-fyou@youremail.com
Pedram
  • 15,766
  • 10
  • 44
  • 73
0

If the error message continues with "MAIL FROM not accepted from server" you should change system/library/mail/smtp.php

Look for these 2 lines (mine was at line 156):

fputs($handle, 'MAIL FROM: <' . $this->smtp_username . '>XVERP' . "\r\n");
fputs($handle, 'MAIL FROM: <' . $this->smtp_username . '>' . "\r\n");

and change it to:

fputs($handle, 'MAIL FROM: <' . $this->from . '>XVERP' . "\r\n");
fputs($handle, 'MAIL FROM: <' . $this->from . '>' . "\r\n");
CoolWolf
  • 19
  • 5