1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Grrrr! How can I get this code working?

Discussion in 'White Hat SEO' started by natewex, Oct 6, 2009.

  1. natewex

    natewex Power Member

    Joined:
    Sep 22, 2009
    Messages:
    602
    Likes Received:
    127
    Location:
    Ireland
    Want a basic fill out form on a site Im doing.

    http://www.freecontactform.com/email_form.php

    Have pasted the first lot of code into my contact form and its showing up just fine.

    The second lot of code, the php, seems to be working on my site also (e.g. I fill out the form, click send and get the thank you for submitting page) -- BUT the mail doesnt come through to my inbox!

    I have put my email in the first paragraph in the php:

    // EDIT THE 2 LINES BELOW AS REQUIRED
    $email_to = "you@yourdomain.com";
    $email_subject = "Your email subject line";

    ... and filled out the subject line also. But it still doesnt work!

    Do I have to edit something here:

    // create email headers
    $headers = 'From: '.$email_from."\r\n".
    'Reply-To: '.$email_from."\r\n" .
    'X-Mailer: PHP/' . phpversion();
    @mail($email_to, $email_subject, $email_message, $headers);
    ?>

    Thanks guys!
     
  2. Sundace60

    Sundace60 Registered Member

    Joined:
    Jun 22, 2009
    Messages:
    53
    Likes Received:
    18
    Not trying to be a smart a$$,but did you check to see if your spam filter caught it. I use this same service and I have no problem.

    Also, I am one of those who did not check my spam filter too!!! I learned by experience.
     
  3. natewex

    natewex Power Member

    Joined:
    Sep 22, 2009
    Messages:
    602
    Likes Received:
    127
    Location:
    Ireland
    i dont have a spam filter dude!
    Posted via Mobile Device
     
  4. warrior skunk

    warrior skunk Newbie

    Joined:
    Sep 1, 2009
    Messages:
    40
    Likes Received:
    22
    If I were you I would try to remove the @ symbol before mail. That symbol blocks the warnings that may be returned from the function. If you remove it and try again you hopefully will get a warning and hopefully we can help from there.
     
  5. natewex

    natewex Power Member

    Joined:
    Sep 22, 2009
    Messages:
    602
    Likes Received:
    127
    Location:
    Ireland
    Warning: mail() has been disabled for security reasons in *************************.ie/send_form_email.php on line 73


    Any ideas?
     
  6. warrior skunk

    warrior skunk Newbie

    Joined:
    Sep 1, 2009
    Messages:
    40
    Likes Received:
    22
    Well your host may have disabled the mail() function. If this is the case you would have to ask them to enable it for you. If that is not the case then I would have to do more research lol.

    This site has instructions on how to tell if the functions is disabled:
    hxxp://drupal.org/node/214402
     
  7. leprakhauns

    leprakhauns Registered Member

    Joined:
    Sep 8, 2009
    Messages:
    84
    Likes Received:
    15
    Occupation:
    PHP Programmer
    Location:
    New York
    Home Page:
    Who is your host so I know never to go with them?
     
  8. natewex

    natewex Power Member

    Joined:
    Sep 22, 2009
    Messages:
    602
    Likes Received:
    127
    Location:
    Ireland
    lol is that the reason? Actually doing it for a client of a friend and he has his own server. That the prob then?