简体   繁体   中英

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. 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) :

echo "Testing " | mailx -"Test Subject Line" 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. 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");
}

`

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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