php SMTP“错误:服务器不接受数据!”InMotionHosting上的Opencart 2.3

k2fxgqgv  于 2022-12-28  发布在  PHP
关注(0)|答案(2)|浏览(150)

我在Inmotionhosting上安装了一个全新的Opencart 2.3.0.2,除了邮件设置外,所有的设置都是默认的,我尝试了很多不同的组合。虽然它显示的是"Error: DATA not accepted from server!",但它成功地发送了邮件!
托管支持中心说一切都没问题,所以应该是编码问题!
邮件设置:

Mail Protocol: SMTP
Mail Parameters: -fnoreply@mywebsite.com
SMTP Hostname: mail.mywebsite.com
SMTP Username: noreply@mywebsite.com
SMTP Password: ********
SMTP Port: 587
SMTP Timeout: 5

完整错误详细信息:

Fatal error:  Uncaught exception 'Exception' with message 'Error: DATA not accepted from server!' in /home/mywebsite/public_html/mywebsite.com/oc/system/library/mail.php:409
Stack trace:
#0 /home/mywebsite/public_html/mywebsite.com/oc/catalog/model/account/customer.php(81): Mail->send()
#1 [internal function]: ModelAccountCustomer->addCustomer(Array)
#2 /home/mywebsite/public_html/mywebsite.com/oc/system/engine/loader.php(178): call_user_func_array(Array, Array)
#3 [internal function]: Loader->{closure}(Array, Array)
#4 /home/mywebsite/public_html/mywebsite.com/oc/system/engine/proxy.php(25): call_user_func_array(Object(Closure), Array)
#5 /home/mywebsite/public_html/mywebsite.com/oc/catalog/controller/account/register.php(21): Proxy->__call('addCustomer', Array)
#6 /home/mywebsite/public_html/mywebsite.com/oc/catalog/controller/account/register.php(21): Proxy->addCustomer(Array)
#7 [internal function]: ControllerAccountRegister->index()
#8 /home/mywebsite/public_html/mywebsite.com/oc/system/engine/action.php(51): call_user_func_array(Array, Array)
#9 /home/sabour in /home/mywebsite/public_html/mywebsite.com/oc/system/library/mail.php on line 409

你知道怎样消除这个错误吗?

t1rydlwq

t1rydlwq1#

我已经在上面评论过了,但是如果这不能解决你的问题,还有一系列的配置步骤要完成如下:
这里是完整的文章,我从获得:
https://opencartforum.com/topic/23861-resheno-yandex-takoy-yandex-ne-otpravlyayutsya-pisma-vydaet-oshibku-data-not-accepted-from-server/?page=2
Opencart 2.0+修复
首先编辑文件catalog/controller/information/contact.php查找行:

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

将其更改为:

$ Mail-> setFrom ($ this-> config-> get ('config_email'));

这样做的目的是将"发件人"字段设置为与您的商店的主电子邮件地址相同。
现在找到这一行:

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

将其更改为:

$ Mail-> setReplyTo ($ this-> request-> post ['email']);
$ Mail-> setSender ($ this-> config-> get ('config_email'));

现在我们需要编辑system/library/mail.php文件你只需要修改一行:

$ Header = 'Reply-To:? = UTF-8 B??'. . base64_encode ($ this-> replyto). '='. '<'. $ This-> from. '>'. $ This-> newline;

将其更改为:

$ Header = 'Reply-To:? = UTF-8 B??'. . base64_encode ($ this-> replyto). '='. '<'. $ This-> replyto. '>'. $ This-> newline;

这里也有类似的问题:
phpmailer - The following SMTP Error: Data not accepted

iq0todco

iq0todco2#

解决了

在我的例子中,问题是SMTP HOSTNAME,实际上应该是共享主机的primary domain name,而不是add-on domain

Mail Protocol: SMTP
Mail Parameters: -fnoreply@addon-domain.com
>>> SMTP Hostname: mail.primary-domain.com <<<
SMTP Username: noreply@addon-domain.com
SMTP Password: ********
SMTP Port: 587
SMTP Timeout: 5

我想知道为什么www.example.com的现场支持InmotionHosting.com没有意识到这一点!

相关问题