Simple PHP Contact Form

Discussion in 'PHP' started by Vadym, Mar 17, 2007.

  1. #1
    I'm having troubles with my contact form. It doesn't seem to be sending the e-mails to the address I specified. Everything else works fine. Could anyone help me out? Here's the code.

    mailer.php
    html code

     
    Vadym, Mar 17, 2007 IP
  2. maonnie

    maonnie Member

    Messages:
    71
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #2
    Try adding:

    ini_set("sendmail_from", "xxxxxxxxxxxx@hotmail.com");

    before your mail call.
     
    maonnie, Mar 17, 2007 IP
  3. Vadym

    Vadym Peon

    Messages:
    2,857
    Likes Received:
    95
    Best Answers:
    0
    Trophy Points:
    0
    #3
    No go. Anymore ideas?
     
    Vadym, Mar 17, 2007 IP
  4. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #4
    Are you trying to use Hotmail to send? Or receive?

    I have heard from others they have some onery filters.
     
    Colbyt, Mar 17, 2007 IP
  5. Vadym

    Vadym Peon

    Messages:
    2,857
    Likes Received:
    95
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Im trying to recieve the form onto a hotmail account.

    Is Hotmail pulling on me what they do with any incoming gmail emails?
     
    Vadym, Mar 17, 2007 IP
  6. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #6
    I saw a couple of threads here or at another forum where a person was unable to send to Hotmail accounts.

    I copied your script and plan to upload it to my server later and then try to send mail to myself. If it works I will pm you the link so you can test it.

    If I get any error message I will forward them to you.
     
    Colbyt, Mar 17, 2007 IP
    Vadym likes this.
  7. mypapit

    mypapit Peon

    Messages:
    26
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Should be careful, mail() is vulnerable to mail injection attack for spammers
     
    mypapit, Mar 17, 2007 IP
  8. Vadym

    Vadym Peon

    Messages:
    2,857
    Likes Received:
    95
    Best Answers:
    0
    Trophy Points:
    0
    #8
    How so? And I doubt that the content that I have would intrest spammers in any way.
     
    Vadym, Mar 17, 2007 IP
  9. maonnie

    maonnie Member

    Messages:
    71
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #9
    Check the phpinfo() output, if you host uses windows check there should be an smtp server configured, if not check the sendmail path is correct, but it'd probably be quicker to just email the host/search their support site.

    If you did:

    mail( "xxxxxxxxxxxx@hotmail.com", "xxxxxxxxxxx Contact Form", $mtx_message, "From: ". $_POST['from']);

    then a spammer could post from as "imaspammer@wespamlost.com\r\nBcc: Ididntaskfor@thisemail.com, etc..\r\n\r\nRead my spam!" and send email to whoever he wants via your form - you're not, so it won't effect you.
     
    maonnie, Mar 18, 2007 IP