web hosting上opencart发送邮件问题解决方法

按照网上的方法,一直去尝试解决 opencart 2.0 出现的 “Error: EHLO not accepted from server” 问题,但是一直都没有成功。后来翻墙google在一个英文网站上找到了答案:

“This topic is just for the purpose of sharing information on one of the problem spots in OpenCart - SMTPS.

My mail server allows using only SMTP port 25 from localhost and only SMTPS port 465 from outside.”


我的场景如下:购买了一个web hosting和一个域名xxxx.com,然后再该webhosting上装了opencart2.0.3.1,opencart上注册用户的时候就报错:“Error: EHLO not accepted from server”,原因就在于opencart无法使用我在opencart上指定的邮箱发送成功注册信息给客户。于是,问题自然而然出在opencart邮件客户端的配置上。


我一开始也是按照cpanel邮箱 xxxx@xxxx.com 的客户端来配置:

用户名: xxxx@xxxx.com 
 密码: 使用电子邮件帐户的密码。
 接收服务器: xxxx.com •IMAP 端口: 993
 •POP3 端口: 995
 发送服务器: xxxx.com •SMTP 端口: 465
 IMAP、POP3 和 SMTP 需要身份验证。

但是该方法确定不能解决上述问题的,问题的根本原因就在于上述那段英语。中文叙述如下:我的opencart是跑着web hosting的,而opencart发送邮件也是利用cpanel邮箱来发送邮件(也就是说在webhosting主机上利用smtp发送邮件),所以不应该按照上述方式来配置邮件。相反,应该按照localhost和25端口的配置方式:

另外,注意打开ssl选项哦:

现在注册客户,得到的结果如下:

而且,成功发送邮件。


附上英文原文:

“This topic is just for the purpose of sharing information on one of the problem spots in OpenCart - SMTPS.

My mail server allows using only SMTP port 25 from localhost and only SMTPS port 465 from outside.

If your mail server works the same way and SMTP in OpenCart is not working, then try this after making sure that your mail server works (try telnet on port 25 and a remote email client on port 465), your firewall does not block port 25 and the smtpd service is running: 

1. Since you are sending mail from inside the server, you should use localhost(or 127.0.0.1 as that is ipv4 only) for your SMTP host - do NOT use your domain/host name here, and NOT your public IP address.

2. Your SMTP port # should be 25- NOT 465. 
If you wanted to connect from outside by specifying http://www.yourwebsite.com and port 465, depending on your mail server config, the connection would be either rejected, or encrypted, so negotiation with your MTA would result in OC validation errors (like AUTH, EHLO etc. not allowed, or fsockopen errors Connection refused)

3. Yourusername and password should be EMPTY if you SMTP (I mean SMTP, not SMTPS) server requires no authentication. If that is the case you will see something like this in telnet:

CODE:   SELECT ALL
[test@myserver ~]$ telnet yourwebsite.com 25
Trying 142.102.17.25...
Connected to yourwebsite.com.
Escape character is '^]'.
220 mail.yourwebsite.com ESMTP Postfix
EHLO yourwebsite.com
250-mail.yourwebsite.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN


As you see there is no AUTH PLAIN or AUTH LOGIN here, which OC will not like

4. Leave the default SMTP timeout of 5

This configuration works with OpenCart 1.5.1.3 and newer.”


Enabling SSL in the OpenCart Dashboard

  1. Log into the OpenCart Dashboard
  2. Go to System > Settings
  3. Click on the Server tab
  4. Check the radio button to use SSL


参考:

http://forum.opencart.com/viewtopic.php?f=19&t=87675

http://www.inmotionhosting.com/support/edu/opencart/setting-up-payment-gateways/how-to-enable-ssl-connection-in-opencart



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值