Help With Simple PHP Email Form

Discussion in 'HTML & Website Design' started by skaterkee, Nov 30, 2008.

  1. #1
    Hey, I'm using a simple PHP email form where the user inputs their email and clicks submit.

    It works perfectly well but I'm using Gmail's vacation function to act as an auto responder (aka thanks for joining the mailing list).

    This is the bit I don't get. It's actually my server sending the email so my server gets the automatic reply not my users.

    How can I sort that out?
     
    skaterkee, Nov 30, 2008 IP
  2. Jme

    Jme Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You need to set a from header in your email and set it to the users e-mail address.
    
    $headers = "From: " . $email . " <" . $email . ">";
    mail($to, $subject, $msg, $headers);
    
    PHP:
    $email being the users e-mail adress they used to sign up.
    I think that's how you do it.
     
    Jme, Nov 30, 2008 IP
  3. skaterkee

    skaterkee Well-Known Member

    Messages:
    651
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    138
    #3
    Thanks I'll give it a go later.
     
    skaterkee, Nov 30, 2008 IP
  4. skaterkee

    skaterkee Well-Known Member

    Messages:
    651
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    138
    #4
    well it worked to a degree, it is no longer sent from my server in the from field although it is still mailed by it and therefore the responder won't work.

    I attached an image.

    Do you think it's just google and I should get a real auto responder?
     

    Attached Files:

    skaterkee, Nov 30, 2008 IP