I new to php but im trying to learn. Im trying to get the php mailer to work but it gives me this error
"Warning: Cannot modify header information - headers already sent by (output started at /home/content/82/8370882/html/gmg/sendmail.php:2) in /home/content/82/8370882/html/gmg/sendmail.php on line 11"
This is script for form:
<form name="contact" method="post" action="sendmail.php" onsubmit="return Validations();">
<label>Name: (required) </label><input class="input1" id="name" name="name" type="text" value="" />
<label>Email: (required) </label><input class="input1" id="email" name="email" type="text" value="" />
<label>Phone: (required) </label><input class="input1" id="phone" name="phone" type="text" value="" />
<label>Comments: (required) </label><textarea class="input2" name="comments" id="comments" cols="" rows=""></textarea><br />
<input type="image" src="images/submit-button.jpg" alt="" name="submit" value="" />
</form>
and the is mailer script:
<?php
if(isset($_POST['submit'])) {
$msg = 'Name: ' .$_POST['name'] ."\n"
.'Email: ' .$_POST['email'] ."\n"
.'Phone: ' .$_POST['phone'] ."\n"
.'Comments: ' .$_POST['comments'];
mail('johndoe@gmail.com', ' Quote', $msg);
header('location: thank-you.php');
} else {
header('location: contact-us.php');
exit(0);
}
?>
Can anyone help me figure out what wrong?
thanks


