PHP mail()函数不发送邮件到除gmail之外的邮件地址

时间:2017-09-22 12:57:55

标签: php

我正在使用php mail()函数。邮件只发送到gmail地址而不是其他人。请参考以下代码。

$to = 'contact@mydomain.com';
    $from = $buyerEmail;
    $fromc = 'noreply@mydomain.com';    
    $subject = 'confirmation';

    $body = "Hello<br><br>
            Payment Received<br><br>
            Name: <strong>".$buyerFirstName." ".$buyerMiddleName." ".$buyerLastName."</strong><br>
            Billing Address Line 1: ".$buyerAddress."<br>
            Billing Address Line 2: ".$buyerAddress2."<br>
            City: ".$buyerCity."<br>
            Country: ".$buyerCountry."<br>
            State: ".$buyerState."<br>
            ZIP/PIN: ".$buyerPinCode."<br>
            Email ID: ".$buyerEmail."<br>
            Payment For: ".$buyerProduct."<br>
            <br>
            Transaction details:
            <br>            
            Date of Tour: ".$orderid."<br><br>
            Amount (Paid) AED: <strong>".$amountlast."</strong><br>
            Trans ID: <strong>".$charge_id."</strong><br>
            Paid using: ".$buyerPayBy."<br>
            ";

    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headers .= "From: $from";

    $headerss  = 'MIME-Version: 1.0' . "\r\n";
    $headerss .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headerss .= "From: $fromc";

    mail($to, $subject, $body, $headers);

    mail($from, $subject, $body, $headerss);

以上代码在我以前的域名上正常运行。请帮我。提前谢谢。

0 个答案:

没有答案