0

I am using php mail() function. Mails are only sending to gmail addresses not to others. Please refer the code below.

$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);

The above code is working properly on my previous domain. Please help me. Thanks in advance.

0 Answers0