简体   繁体   English

表格不会发送信息到电子邮件地址(虽然工作在其他地方)

[英]Form doesn't send info to email address (works on others though)

My client has a Wordpress content management system to which I added a simple contact form with a php form handler. 我的客户端有一个Wordpress内容管理系统,我在其中添加了一个简单的联系表单和一个php表单处理程序。 The contact form sends the information by email correctly to all three of my email addressses, but when I change to my client's email address the email never arrives. 联系表单通过电子邮件将信息正确地发送到我的所有三个电子邮件地址,但是当我更改为客户端的电子邮件地址时,电子邮件永远不会到达。 I have run out of ideas where I could look for the problem. 我已经没有想法可以找到问题了。 No it does not go to his junk mail folder. 不,它没有去他的垃圾邮件文件夹。 :) :)

Sounds like the email is being routed "internally" through your clients network and not out onto the internet. 听起来好像电子邮件正在通过客户网络“内部”路由,而不是通过互联网传输。 The chances are they have some restrictions on what machines can be used to send emails internally, or the mail routing system sees the internal email as being "different" and does something odd with it. 很可能他们对可以用来在内部发送电子邮件的机器有一些限制,或者邮件路由系统认为内部电子邮件是“不同的”并且做了一些奇怪的事情。

Try using (from a cli) : 尝试使用(来自cli):

echo "Testing " | echo“测试”| mailx -"Test Subject Line" user@company.co.uk mailx - “测试主题行”user@company.co.uk

What is the mail function that you are using? 你正在使用的邮件功能是什么? Do you attach a header to it? 你有一个标题吗? It sounds like it is being marked as spam from the exchange server. 听起来它被标记为来自Exchange服务器的垃圾邮件。 What I use (and have always worked for me) is something like this: ` 我使用的(并且一直为我工作)是这样的:`

function mailme($sendto,$sendername,$from,$subject,$sendmailbody,$bcc="")
{
    $subject = nl2br($subject);
    $sendmailbody = nl2br($sendmailbody);
    if($bcc!="")
    {
        $headers = "Bcc: ".$bcc."\n";
    }
    $headers = "MIME-Version: 1.0\n";
    $headers .= "Content-type: text/html; charset=utf-8 \nContent-Transfer-Encoding: 8bit\n";
    $headers .= "X-Priority: 3\n";
    $headers .= "X-MSMail-Priority: Normal\n";
    $headers .= "X-Mailer: PHP/"."MIME-Version: 1.0\n";
    $headers .= "From: " . $from . "\n";
    $headers .= "Content-Type: text/html\n";
    mail("$sendto","$subject","$sendmailbody","$headers");
}

` `

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

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