Jump to content


php mail form help

  • Please log in to reply
1 reply to this topic

#1 cuekillar

  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 11 October 2006 - 06:46 PM


<form action="send_email.php3" method="POST">
From:<input type="text" size="22" name="from" value="urisp@urisp.com"><br>
subject:<input type="text" size="22" name="subject" value="diary entry suggestion"><br>
Let me recieve newsletters!<input type="checkbox" name="php_script_list" value="yes"><br>
<textarea name="contents" rows="5" cols="40"></textarea><br>
Enter your message and click submit!<input type="submit" name="B1" value="Submit"><input type="reset" name="B2" value="Reset">


send_email.php3 -----

$to = "cue_killar@yahoo.co.uk";
$from_header = "From: $from";
if($contents != "")
//send mail - $subject & $contents come from surfer input
mail($to, $subject, $contents, $from_header);
// redirect back to url visitor came from
header("Location: $HTTP_REFERER");
print("<HTML><BODY>Error, no comments were submitted!");


The problem is that I'm trying to get this script to work and although it looks fine to me, when I go to the mail.html , fill out the form and submit all i get is this....

Error, no comments were submitted!");

and I dont get the email
ignore the mailing list, i no its not working or anything.

http://www.nintendo....e.com/mail.html try it and see if it works for you 
hope you can help

#2 Jocka

  • Members
  • PipPipPip
  • Advanced Member
  • 344 posts
  • LocationDallas, Texas

Posted 11 October 2006 - 08:12 PM

Yea.. you'll need to set those variables first.


$contents = $_POST['contents'];
$from = $_POST['from'];
$subject = $_POST['subject'];


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users