467,118 Members | 916 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,118 developers. It's quick & easy.

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="sendmail.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 "Congratulations your email has been sent";
?>
</body>
</html>
[/php]
Sep 28 '06 #1
  • viewed: 1475
Share:
2 Replies
ronverdonk
Expert 4TB
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:
Sep 28 '06 #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:
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.
Sep 28 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by lawrence | last post: by
2 posts views Thread by Babaloo | last post: by
4 posts views Thread by jim | last post: by
1 post views Thread by Shelly | last post: by
1 post views Thread by Gaz | last post: by
4 posts views Thread by Nilesh | last post: by
11 posts views Thread by Taras_96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.