PHP Email Form not working!

Discussion in 'HTML & Website Design' started by mcdeere02, Aug 7, 2009.

Thread Status:
Not open for further replies.
  1. #1
    Hello. I have got an enquiry form on my website which should send the users input to my email address. The email arrives but it does not include any of the forms content, i.e. the mail is blank. Can anyone help? Here is my send mail script:

    <?php
    $email = $_POST["emailaddress"] ;
    $telephone = $_POST["telephonenumber"] ;
    $type = $_POST["enquirytype"] ;
    $message = $_POST["enquiry"] ;

    mail( "me@me.com", "Website Enquiry", $message, "From: $email" ) ;

    header( "Location: http://(Web Address)/Enquiry_Submitted.html" )
    ; ?>
     
    mcdeere02, Aug 7, 2009 IP
  2. geoiss2004

    geoiss2004 Guest

    Messages:
    1,454
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    0
    #2
    change all " to ' and remove those spaces after and before your brackets
     
    geoiss2004, Aug 7, 2009 IP
  3. geoiss2004

    geoiss2004 Guest

    Messages:
    1,454
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    0
    #3
    also, you're actually only posting the $message variable. the email, telephone and type arent being included. you need to combine them into your $message variable i.e.

    $message = 'telephone: '.$telephone.'<br />type: '.$type.'';
     
    geoiss2004, Aug 7, 2009 IP
Thread Status:
Not open for further replies.