Contact Form.php
Please can someone help me on this as i have tried to implement the code given by hostgatore with no avail
as i have set up this php contact form on my server as is below, with my hot-mail account it works fine but would like it to have a different header instead of the server name header, how can i do this. snap shot taken,
A link of hostgatore faq suggestions http://support.hostgator.com/articles/php-email-from-header does not work when added,. can somone please fix and help me on this 3 days of no sleep for something simple i guess,
Thanx in advance
Contact Form.php
<?php $to = 'no-reply@hotmail.com'; // please change this email id $errors = array(); // print_r($_POST); // Check if name has been entered if (!isset($_POST['name'])) { $errors['name'] = 'Please enter your name'; } // Check if email has been entered and is valid if (!isset($_POST['email']) || !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) { $errors['email'] = 'Please enter a valid email address'; } //Check if message has been entered if (!isset($_POST['message'])) { $errors['message'] = 'Please enter your message'; } $errorOutput = ''; if(!empty($errors)){ $errorOutput .= '<div class="alert alert-danger alert-dismissible" role="alert">'; $errorOutput .= '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>'; $errorOutput .= '<ul>'; foreach ($errors as $key => $value) { $errorOutput .= '<li>'.$value.'</li>'; } $errorOutput .= '</ul>'; $errorOutput .= '</div>'; echo $errorOutput; die(); } $name = $_POST['name']; $email = $_POST['email']; $message = $_POST['message']; $from = $email; $subject = 'Contact Form : 3GS MESSANGER'; $body = "From: $name\n E-Mail: $email\n Message:\n $message"; //send the email $result = ''; if (mail ($to, $subject, $body)) { $result .= '<div class="alert alert-success alert-dismissible" role="alert">'; $result .= '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>'; $result .= 'Thank You! Feedback in 24 Hours'; $result .= '</div>'; echo $result; die(); } $result = ''; $result .= '<div class="alert alert-danger alert-dismissible" role="alert">'; $result .= '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>'; $result .= 'Something bad happend during sending this message. Please try again later'; $result .= '</div>'; echo $result; die(); ?>