简体   繁体   English

Opencart 1.5.5.1:不发送确认电子邮件

[英]Opencart 1.5.5.1 : Not sending confirmation emails

My opencart is not sending out confirmation emails. 我的opencart没有发送确认电子邮件。 I am using mail(), not smtp. 我正在使用mail(),而不是smtp。 Tried sending mail trough custom php file and it works fine, therefore there is no problems with the server. 尝试通过自定义php文件发送邮件,并且工作正常,因此服务器没有问题。

Settings (empty): 设置 (空):

在此处输入图片说明

EDIT : Solved the problem. 编辑:解决了问题。 Check the answer. 检查答案。

Solved the problem. 解决了问题。

Change the file: 更改文件:

system/library/ mail.php | 系统/库/ mail.php | line 97 97

Remove second $this->newline from code. 从代码中删除第二个 $this->newline

$header .= 'Content-Type: multipart/related; boundary="' . $boundary . '"' . $this->newline . $this->newline;

Final look: 最终外观:

$header .= 'Content-Type: multipart/related; boundary="' . $boundary . '"' . $this->newline;

It works just fine for me now. 现在对我来说效果很好。

For me, it was also a server issue. 对我来说,这也是服务器问题。

I made the amendments to mail.php and I also had the error 我对mail.php进行了修改,并且也出现了错误

sendmail: fatal: chdir /var/spool/postfix: Permission denied sendmail:致命:chdir / var / spool / postfix:权限被拒绝

showing up in /var/log/httpd/error_log. 显示在/ var / log / httpd / error_log中。 This was caused by the apache user not having SELinux permission to send email. 这是由于apache用户没有SELinux许可来发送电子邮件。 This could also occur on other distributions which use SELinux (particularly Fedora and CentOS, but possibly others as well), if it is set to "Enforcing". 如果将其设置为“ Enforcing”,则在使用SELinux的其他发行版(尤其是Fedora和CentOS,但也可能是其他发行版)上也可能发生这种情况。

You can check this by using 您可以使用

/usr/sbin/getsebool httpd_can_sendmail which will report / usr / sbin / getsebool httpd_can_sendmail将报告

httpd_can_sendmail --> {on|off} httpd_can_sendmail-> {on | off}

and if it is off, you can turn it on using sudo setsebool -P httpd_can_sendmail 1 with the "-P" for persistent (across reboots). 如果已关闭,则可以使用sudo setsebool -P httpd_can_sendmail 1(带有“ -P”)将其打开以进行持久(跨重新引导)。

Hope this helps someone! 希望这对某人有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM