Contact form stopped working...!?

Discussion in 'PHP' started by Bally12345, Jan 20, 2008.

  1. #1
    It was working fine lastnight and tested it today and no email coming through... Can anyone see anything wrong with the following code?

    
    <?php
    /***************************************************\
     * PHP 4.1.0+
     
    \***************************************************/
    
    
    
    $to = "email_removed@hotmail.com";
    $MailSubject="Booking Request";
    $firstName=$_POST["firstname"];
    $lastName=$_POST["lastname"];
    $address= $_POST["address"];
    $email=$_POST["email"];
    $from=$_POST["email"];
    $town=$_POST["town"];
    $country=$_POST["country"];
    $postcode=$_POST["postcode"];
    $location= $_POST["location"];
    $tel=$_POST["telephone"];
    $typeoffunction=$_POST["typeoffunction"];
    $date=$_POST["date"];
    $noofguests=$_POST["noofguests"];
    $timescale=$_POST["timescale"];
    $requirements=$_POST["requirements"];
    $howdidyouhearofus=$_POST["howdidyouhearofus"];
    
    
    $MessageText = "Booking Request\n\n$firstName $lastName has just submitted their information, here are the details which were entered:
    \nFirst name: $firstName
    \nLast name: $lastName
    \nAddress: $address
    \nTown: $town
    \nCountry: $country
    \nPostcode: $postcode
    \nTelephone: $tel
    \nE-mail: $email";
    \n
    \nVenue/Location : $location
    \nType of function: $typeoffunction
    \nRequirements: $requirements 
    \nDate : $date
    \nNumber of guests: $noofguests 
    \nTimescale: $timescale 
    \n
    \nHow did you hear of us: $howdidyouhearofus 
    
    mail("$to", "$MailSubject", "$MessageText", "From: $from <$from>\r\nReply-To: $from <$from>\r\n" );
    
    ?>
    
    PHP:
     
    Bally12345, Jan 20, 2008 IP
  2. Bally12345

    Bally12345 Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Just noticed the mistake, made the changes and thought I fixed it but still doesnt seem to work

    
    <?php
    /***************************************************\
     * PHP 4.1.0+
     
    \***************************************************/
    
    
    
    $to = "email_removed@hotmail.com";
    $MailSubject="Booking Request";
    $firstName=$_POST["firstname"];
    $lastName=$_POST["lastname"];
    $address= $_POST["address"];
    $email=$_POST["email"];
    $from=$_POST["email"];
    $town=$_POST["town"];
    $country=$_POST["country"];
    $postcode=$_POST["postcode"];
    $location= $_POST["location"];
    $tel=$_POST["telephone"];
    $typeoffunction=$_POST["typeoffunction"];
    $date=$_POST["date"];
    $noofguests=$_POST["noofguests"];
    $timescale=$_POST["timescale"];
    $requirements=$_POST["requirements"];
    $howdidyouhearofus=$_POST["howdidyouhearofus"];
    
    
    $MessageText = "Booking Request\n\n$firstName $lastName has just submitted their information, here are the details which were entered:
    \nFirst name: $firstName
    \nLast name: $lastName
    \nAddress: $address
    \nTown: $town
    \nCountry: $country
    \nPostcode: $postcode
    \nTelephone: $tel
    \nE-mail: $email
    \n
    \nVenue/Location : $location
    \nType of function: $typeoffunction
    \nRequirements: $requirements 
    \nDate : $date
    \nNumber of guests: $noofguests 
    \nTimescale: $timescale 
    \n
    \nHow did you hear of us: $howdidyouhearofus";
    
    mail("$to", "$MailSubject", "$MessageText", "From: $from <$from>\r\nReply-To: $from <$from>\r\n" );
    
    ?>
    PHP:
     
    Bally12345, Jan 20, 2008 IP
  3. HuggyStudios

    HuggyStudios Well-Known Member

    Messages:
    724
    Likes Received:
    20
    Best Answers:
    26
    Trophy Points:
    165
    #3
    Add or die("Mail Error");

    See if its the mail funtion playing up.
     
    HuggyStudios, Jan 20, 2008 IP
  4. wisdomtool

    wisdomtool Moderator Staff

    Messages:
    15,826
    Likes Received:
    1,367
    Best Answers:
    1
    Trophy Points:
    455
    #4
    Also check one thing try to send to other email accounts other than Hotmail, sometimes Hotmail may have some filtering mechanism in place, maybe try sending to Gmail to try instead.
     
    wisdomtool, Jan 20, 2008 IP
  5. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Your form is badly vulnerable to abuse by spammers.
     
    SmallPotatoes, Jan 20, 2008 IP