trying to use php and sendmail to generate e-mails from form data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wendallsan
    New Member
    • Sep 2006
    • 5

    #1

    trying to use php and sendmail to generate e-mails from form data

    Hi all,

    I know that this should be an easy thing, but I haven't figured out how to get this to work on my server at home. I have a roommate who is using PHPBB on his site on the server and that is able to send out e-mails no problem. I have created a simple form that sends data to a php page that then gets the data and then should send it out using the send() function. What is going on in actuality is that upon submitting the html form, the browser just sits there indefinately, it doesn't pass an error message or time out or anything.

    I am running Linspire 5.0 with Apache 1.3 and PHP 4.3.10.

    I know nothing about sendmail, although the mail() function looks easy enough. I haven't found the php error_log yet. I ran a phpinfo() to try to find it's location, and it just says 'error_log: no value'. Can anyone tell me where I should start? Here is the code for my simple form and php page:

    [php]
    <html>
    <body>
    <form method="post" action="sendmai l.php">
    Email: <input name="email" type="text" /><br>
    Message:
    <textarea name="message" rows="10" cols="30"></textarea>
    <input type="submit" />
    </form>
    </body>
    </html>
    [/php]

    [php]
    <html>
    <body>
    <?
    $email = $_GET['email'] ;
    $message = $_GET['message'] ;
    mail( "wendall_dogman @yahoo.com", "Email Subject", $message, "From: $email" );
    print "Congratulation s your email has been sent";
    ?>
    </body>
    </html>
    [/php]
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    In your first script tou define the form with action=post.
    In your receiving form you use the $_GET array to get the values. Of course your variables do not have a value. You should fill your variables from the $_POST array..

    Ronald :cool:

    Comment

    • wendallsan
      New Member
      • Sep 2006
      • 5

      #3
      Originally posted by ronverdonk
      In your first script tou define the form with action=post.
      In your receiving form you use the $_GET array to get the values. Of course your variables do not have a value. You should fill your variables from the $_POST array..

      Ronald :cool:
      wow, that's a no-brainer. I have changed the $_GET array references to $_POST. Still the same result, though, the page just hangs. Any other ideas? Thanks again.

      Comment

      Working...