Jump to content

快疯了!!!1.2.5和1.3.0的contact us均无法发送邮件


jkungfu

Recommended Posts

安装后,用1.3.0的EMAIL后台测试,可以发送no-reply Test message - Prestashop‎ 这样的邮件,证明主机提供了邮件功能,且完好。

但contact us无法发送,它会显示已经发送成功,但根本就收不到邮件!!!

以下脚本也可以证明邮件可以发送成功!


<?php
$to = "[email protected]";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "[email protected]";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>


快疯了!!到底怎么解决啊!!!

Link to comment
Share on other sites

PS邮件功能就像个摆设,不管是mail()还是SMTP,都不起作用,前者提示成功,但根本收不到,测试也正常

SMTP,设置之后,在contact us页提交之后,会自动跳转到首页,而且也是收不到任何邮件的!

Link to comment
Share on other sites

1. 即使ISP的主机有email功能,也必须设置正确,才能使用。往往某些ISP会限制,或被限制,其主机的发信功能。请咨询你的ISP是否存在这方面的限制。

2. prestashop后台测试能发信,仅表示prestashop的mail()是能工作的,不表示你一定会收到email。

3. 你的测试代码有误。请尝试下面的代码:

<?php

$to = '[email protected]'; //your email address (required)
$subject = 'Test php mail() function'; // mail subject (required)
$message = 'Test php mail() function'; // mail body (required)
$headers = ''; // mail header (optional)
$result = mail($to, $subject, $message, $headers);

if ($result == false) 
  echo 'php mail() function does NOT work. Ask your ISP then.';
else
  echo 'php mail() function works!';

?> 

Link to comment
Share on other sites

我的测试代码能让我收到邮件,证明代码是没问题的:

我把忘记密码password.php中的代码:

Mail::Send(intval($cookie->id_lang), ‘password’, ‘Your password’, 
array(’{email}’ => $customer->email, 
‘{lastname}’ => $customer->lastname, 
‘{firstname}’ => $customer->firstname, 
‘{passwd}’ => $password), 
$customer->email, 
$customer->firstname.’ ‘.$customer->lastname); 


换成:

$to = $customer->email; 
$subject = ‘Your password’; 
$from = “[email protected]”; 
$headers = “From: $from”; 
mail($to,$subject,$password,$headers); 

之后,是可以收到prestashop给我的新密码的!!!

就这个邮件问题,我都有点想换程序的冲动了!搞了近两天了,也没搞明白怎么回事!

Link to comment
Share on other sites

就是我用后台EMAIL的测试是正常的!不管是用mail()还是用SMTP都正常,都能发送测试邮件。

但设置完之后,contact us, forgot your password, 订单, 什么的都不会收到任何邮件。

Link to comment
Share on other sites

如果prestashop能(用php mail()或smtp方式)正常发信,另外的php mail()测试也能发信,而你又收不到邮件,很有可能是,域名和邮件服务商,其中一方block了对方,或是互相block。

建议:1. 用域名所带的邮件服务给目标邮件地址发信测试;2. 咨询ISP第三方SMTP发信需要如何定制参数,是否存在限制。

Link to comment
Share on other sites

我直接用 smtp.mydomain.com 来发,结果:
This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

[email protected]
SMTP error from remote mail server after end of data:
host bosimpout-pool.eigbox.net [10.20.55.2]: 552 5.2.0 10.20.18.10 URL in message blacklisted. See http://www.surbl.org

怎么处理?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...