OK, here's the deal. Although I've done a basic PHP email-sending form before, I'm definitely a novice! Based on my past form success, I promised a client that I would build out two forms by tomorrow morning. I have been slaving away all evening and have nothing that will work. I need a quick and dirty solution that will capture the form data and send it to an email address. Simple enough, right? Apparently novice isn't a good enough word. I'm a PHP dunce!!!
Can anyone help to point me in the right direction? I have tried formmail with no success. My old script looked something like the following and isn't doing anything. I click submit and NOTHING happens. Any help would be greatly appreciated!
<?php
$mail_to = "tim@timothygray.com";
$mail_subject = "Website Form Submittal";
$mail_header = "The following user has registered.";
$error_page = "http://www.wrightcomputers.net/contact/index.htm";
$success_page = "http://www.wrightcomputers.net/contact/index.htm";
if($_POST['email'] != '') {
header("Location: $error_page");
} else {
$from = $_POST['email'];
$subject = $mail_subject;
$to = mail_to;
$body = \n $mail_header \n \n $from;
mail($mail_to, $mail_subject, $body);
header("Location: $success_page");
}
?>





Bookmarks