Web Analytics Made Easy -
StatCounter Not retrieving email from simple php form processor - CodingForum

Announcement

Collapse
No announcement yet.

Not retrieving email from simple php form processor

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Not retrieving email from simple php form processor

    The only way to retrieve the data from this form is to include an email address between "<>" tags in the from_who variable (in line 4). In other words, this does not work:

    $from_who="Questionaire";

    Why is this? This is very perplexing. Feel free to modify anything you feel is unnecessary.

    PHP Code:
    <?php

    $youremail
    ="[email protected]";

    $emailsubject="Results";

    $from_who="Questionaire <[email protected]>";

    $pagetitle="Thank You!";

    if (
    getenv(HTTP_CLIENT_IP)){ 
    $user_ip=getenv(HTTP_CLIENT_IP); 

    else { 
    $user_ip=getenv(REMOTE_ADDR); 
    }

    $mailbody.="Did you find the location convenient?\n\n$location\n................................";
    $mailbody.="\n\nDid you find the office comfortable?\n\n$comfort\n................................";
    $mailbody.="\n\nDid you find the equipment easy to use?\n\n$ease\n................................";
    $mailbody.="\n\nDid you find the equipment you needed?\n\n$found\n................................";
    $mailbody.="\n\nDid you find the software you needed?\n\n$software\n................................";
    $mailbody.="\n\nAdditional Comments:\n\n$additional\n................................";
    $mailbody.="\n\nName:\n\n$name\n................................";
    $mailbody.="\n\nEmail Address:\n\n$email\n................................";
    $mailbody.="\n\nPhone Number:\n\n$phone\n................................";
    $mailbody.="\n\nSenders Browser:\n\n$HTTP_USER_AGENT\n................................";
    $mailbody.="\n\nSenders IP Number:\n\n$user_ip\n................................";

    mail("$youremail""$emailsubject""$mailbody""From: $from_who");
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <html>
    <head>
        <title></title>
    </head>

    <body>

    <table>
        <tr>
            <td><h6>Thank you.</h6></td>
        </tr>
    </table>

    </body>
    </html>

  • #2
    http://de3.php.net/manual/en/function.mail.php

    Odds are good your MTA requires it. (think, mail server)

    Comment


    • #3
      & thats exactly what some mail servers require in the mail headers (in *NIX win32 its best [IME] to not use them)

      PHP Code:
      <?php
      mail
      $youremail $emailsubject $mailbody"From: $from_who <$from_who>");
      ?>
      the doubling up of the $from_who is intentional

      <edit>doh , beaten to it , I must be getting old</edit>
      resistance is...

      MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

      Comment

      Working...
      X