Contact form issue???
Posted: Mon Nov 06, 2006 8:44 am
i have this form contact issue that is supposed to work, but for some reason it doesn't and when i contact the webhost, they have fixed this issue before and for some reason they cannot fix this issue now. is there anything wrong with this code that you can see or is there another email script that i can use that will work?? i have to get this email script or any other script working asap. the script that i am using is below. how can this be fixed so that it will work? thanks
this is what the webhost has came back at me saying:
This is the PHP code that i am using on the form
this is what the webhost has came back at me saying:
This is the HTML form I am usingUpon checking on your issue the option Prevent the user \"nobody\" from sending out mail to remote addresses is enabled on this server inorder to prevent spam mails. Because of this server settings, your mailing script doesn't work. Please do check and feel free to get back to us for further assistance.
Code: Select all
<form action="contact.php" method="post" onsubmit="return submitIt2(this)" name="myForm2">
<p><font color="#ff0000">*</font>Name:<br>
<input type="text" name="name" size="35" id="name">
</p>
<p><font color="#ff0000">*</font>Email:<br>
<input name="user_email2" type="text" size="35" id="user_email">
</p>
<p><font color="#ff0000">*</font>Message:<br>
<textarea name="message" rows="10" cols="27" id="message"></textarea>
</p>
<p>
<input type="submit" name="submit2" value="Submit">
</p>
</form>
This is the PHP code that i am using on the form
Code: Select all
#catch and store the content from the form
$name = $_POST["name"];
$user_email2 = $_POST["user_email2"];
$message = $_POST["message"];
#some variables storing info about you
$auth_name2 = "Name here";
$auth_email2 = "mikeswooten@yahoo.com";
$auth_site2 = "Website Name here";
#Auto-Resopnd to person sending mail indicating success
$autorespond = mail("$user_email2", "Thanks For Your Email Inquiry", "Your email was sent successfully to $auth_name2. We will respond as soon as possible.","From:$auth_email2\r\nReply-to:$auth_email2");
#Send the email to the author
if(mail("$auth_email2", "Email From $auth_site2", "From: $name
Email: $user_email2
Message: $message","From:$user_email2\r\nReply-to:$user_email2")){
echo "Thank You <b>$name</b> for contacting <b>$auth_name2</b>, I will respond as soon as possible. <br>Your message has been successfully sent!";
}else{
echo "There was a problem sending your message. We applogize for the inconvenience.";
}