Hello guys, Can anyone help me with a simple form. I need a form like this: A box where the user can enter his email adress. Under it a button: Send this to my email The function will be that a certain text is sent to his email adress. The text is one I choose before. Thanks guys!
Ok...can you tell me why this doesn't work? <?php $EmailTo = $_REQUEST['email']; $Subject = "Coupon emailed by you from SpidaNet"; $email = "talmacelmarian@webstylecreator.com"; $refered_from = $_SERVER['HTTP_REFERER']; $Body = ""; $Body = "You wanted to get this coupon sent to you by email!"; $Body .= "\n"; $Body .= "\n"; $Body .= "You can get it by clicking this link: http://www.paydayadvanceuk.co.uk/news/wp-content/uploads/2011/04/coupon.jpg"; $Body .= "\n"; $Body .= "$refered_from"; $success = mail($EmailTo, $Subject, $Body, "From: <$email>", "-talmacelmarian@webstylecreator.com"); ?> HTML <form method="post" action="feedback1.php" id="friendform" name="friendform"> <font style="color: black;" size="-1"><label style="font-weight: bold;" for="email">Email me the coupon! <br> (You must enter your email) </label></font> <input name="email" type="text"><br> <input name="submit" value="Send now!" type="submit"> <input name="reset" type="reset"> </form> Code (markup):
html form looks okay to me..but your code is terribly messy.. also consider moving this to the php section perhaps.
Does it give you a php error? if so, post it here. if not, echo out your mail() line to ensure that everything that you're passing PHP is correct. also, not sure about your syntax at the end of that line. try rewriting it with mail headers as shown in the example on the php website: <?php $to = 'nobody@example.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: ' . "\r\n" . 'Reply-To: ' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?>
emailmeform.com is the place u wanna go, I've been using it for quite some time. It has a 200 email limit though.