Mail Form not Mailing
Posted: Sun Mar 12, 2006 12:44 am
feyd | Please use
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Hi Guys,
I've been grappling with this mail form quite a bit in the last week or so. I can't seem to get it to mail after error checking. It was working when I used it without the error checking.
[url]http://www.reakt.com.au/inner.php?contact[/url]
I have no idea where to go anymore. I've tried a thousand different ideas .If anyone know why it is broken, please let me know!
Here is the code (sorry it's so long!)Code: Select all
echo "<h1>Contact reAKT!</h1>
<p>Want to let us know of something? Found a broken link? Just want to give us some feedback on the magazine and website? Email us from here and we'll be sure to respond as fast as we possibly can!</p>
<p>If you are looking to make a submission, please use the form located in the <a href=\"inner.php?submit\">submissions area</a>. Submissions submitted through this form will not be correctly routed and may take a long time to be read and replied to.</p>
<div id=\"content\">";
if(isset($_POST['submit'])) {
echo '<div class="phpoutput"><p class="fail">';
//Get the phone number if they entered one
$phone=$_POST['phone'];
//Get the comments they have entered
$comments=$_POST['comments'];
//Check for a name
if(eregi("^[[].' -]{2,15}$", stripslashes(trim($_POST['name'])))) {
$frmname=escape_data($_POST['name']);
} else {
$frmname=FALSE;
echo'Please enter a name.<br />';
}
//Check for an email address
if(eregi("^[[]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$", stripslashes(trim($_POST['email'])))) {
$frmemail=escape_data($_POST['email']);
} else {
$frmemail=FALSE;
echo 'Please enter a valid email address. (example: user@provider.com.au)<br />';
}
//if the details above are all entered, then send the email to online@reakt.com.au
if($frmname && $frmemail) {
//Create the Subject Line
$subject="reAKT! Comments Form Submission";
//Compose simple text message:
$message="
Name: $frmname \n
Email: $frmemail \n
Phone: $phone \n\n
Comments: $comments
";
//Mail the form to online@reakt.com.au
mail("online@reakt.com.au", $subject, $message, $frmemail);
//echo a response
echo "Thankyou, your query will be responded to as soon as possible.";
//If the above has any errors, output the end of the errors.
} else {
echo 'Please fill in all required fields and try again.';
}
echo '</p></div><br />';
}
echo"<form action=\"";$_SERVER['PHP_SELF'];echo "\" method=\"post\">
<fieldset>
<legend>Contact Form</legend>
<div class=\"information\">
<h4>Information</h4>
<p>If you want to make a submission, please don't use this form. Use the submission form located in the <a href=\"inner.php?submit\">submissions section</a>.</p>
</div>
<div class=\"forms\">
<label for=\"name\">Your Name</label><input name=\"name\" id=\"name\" type=\"text\" value=\""; if(isset($_POST['name'])) echo $_POST['name']; echo"\" tabindex=\"1\" />
<label for=\"email\">Your Email</label><input name=\"email\" id=\"email\" type=\"text\" value=\""; if(isset($_POST['email'])) echo $_POST['email']; echo"\" tabindex=\"2\" />
<label for=\"phone\">Your Phone Number</label><input name=\"phone\" id=\"phone\" class=\"sminp\" type=\"text\" value=\""; if(isset($_POST['phone'])) echo $_POST['phone']; echo"\" tabindex=\"3\" />
<label for=\"comments\">Comments</label><textarea cols=\"5\" rows=\"4\" name=\"comments\" id=\"comments\" tabindex=\"4\">"; if(isset($_POST['comments'])) echo $_POST['comments']; echo"</textarea>
<br class=\"brclear\" />
<label></label><input name=\"submit\" class=\"sminp\" type=\"submit\" value=\"Submit\" tabindex=\"5\" />
</div>
</fieldset>
<br class=\"clearrt\" />
</form>
</div>
<hr />";feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]