Mail Contact Form Info not working

the mail() function

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Sat Jul 28, 2012 10:59 pm

Mail Contact Form Info not working

Postby ipjuvares » Sat Jul 28, 2012 11:07 pm

Dear friends, I am a beginner in php and the template code which I have modified and am using, is giving up the error message irrespective of whether i submit the contact form without filling all the details or with all the details. Can someone please help me out with this? If needed i can post the javascript code and the html code i am using with this. here is the php code:

Code: Select all

$error="The following errors occured while processing your form input.<ul>";
$name= isset($_POST['name']) ? $_POST['name'] : '';
$company= isset($_POST['company']) ? $_POST['company'] : '';
$telephone=isset($_POST['telephone']) ? $_POST['telephone'] : '';
$email=isset($_POST['email']) ? $_POST['email'] : '';
$message=isset($_POST['message']) ? $_POST['message'] : '';

if(empty($name) || empty($company) || empty($telephone) || empty($email) || empty($message)){
$error.="You did not complete one or more fields, please go back and try again!";
if($errors==1) echo $error;
$message="Name: ".$name."
Company: ".$company."
Telephone: ".$telephone."
E-mail: ".$email."
Message: ".$message."
$message = stripslashes($message);
mail("","Form Submitted at your website",$message,"From:");
header('Refresh: 0;');

Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 3 guests