Email headers in php. Please Help

Discussion in 'PHP' started by reshadat, Mar 21, 2008.

  1. #1
    HI. I am trying to make a script and I'm having some problem. I'm sending HTML email and therefore trying to send the proper headers. But somehow its not working. The headers are not passed as they are supposed to be passed.The email is not in HTML and also the sender is not the one which I stored in $reg. here is the code:

    $from1 = "MIME-Version: 1.0\n";
    $from1 .= "Content-type: text/html; charset=iso-8859-1\n";
    $from1 .= "From: ".$reg."\n";
    $from1 .= "Reply-To: ".$reg."\n";
    Code (markup):
    And here is the command to send email:
    mail($_POST['email'], $subject, $mess, $from1); //Message to applicant.
    Code (markup):
    Please help me. Thanks!
     
    reshadat, Mar 21, 2008 IP
  2. RoscoeT

    RoscoeT Peon

    Messages:
    78
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Do not do this in this manner, unless you like having your server send spam. Or maybe you're a spammer anyway...


     
    RoscoeT, Mar 22, 2008 IP
  3. reshadat

    reshadat Active Member

    Messages:
    194
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Then What is the correct method? I'm building a script for the first time and don't have that much experience!
     
    reshadat, Mar 22, 2008 IP