What's wrong with my PHP mail

Discussion in 'PHP' started by linhhuchong, Oct 4, 2007.

  1. #1
    My PHP mail works properly with normal email, but with spam protect like Yahoo it is mark as Spam. Do you guy know why?

    This is my code:

    // send email;
    // $content_main
    $to = "$customer_email";
    $subject = $LG["word_hi"]. $customer_name;

    $headers = "";
    $headers .= "MIME-Version: 1.0\n";
    $headers .= "Content-type: text/html; charset=utf-8\n";
    $headers .= "X-Priority: 1\n";
    $headers .= "X-MSMail-Priority: High\n";
    $headers .= "From: $admin_name <$admin_email> \r\n"
    . "To: $customer_name <$customer_email> \r\n"
    . "Reply-to: <$admin_email> \r\n"
    . "Return-path: <$admin_email> \r\n"
    . "X-Mailer: PHP/" . phpversion();

    $message = $LG["word_dear"]." $customer_name ."
    --------------------------<br>
    $content_main
    <br>----------------------------<br>".
    $LG["email_goodbye"];

    mail($to, $subject, $message, $headers);
     
    linhhuchong, Oct 4, 2007 IP
  2. bibel

    bibel Active Member

    Messages:
    289
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #2
    There are many things that contribute to marking a mail as spam. One of the main ones is Content-type: text/html. You have to make a lot of tests before managing to get your email out of spam, and even then, it won't be for long
     
    bibel, Oct 4, 2007 IP
  3. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #3
    nico_swd, Oct 5, 2007 IP