Hey, I am trying to write a mail script and it keeps running through the script with no output whatsoever. Do you know what is wrong. I am attaching the script and email form. Thanks!
Form:
<form action="mailprocessor.php" method="post">
<fieldset class = "fieldset1">
<legend class = "legend">Contact Form</legend>
<dt class = "dt">Name</dt>
<dd><input class = "text_area" type="text" name="name" maxlength="20" size="20"></dd>
<dt class = "dt">Email:</dt>
<dd><input class = "text_area" type="text" name="email" maxlength="20" size="20"></dd>
<dt class = "dt">Text:</dt>
<dd><textarea class = "text_area" name="comments" font-size= 18px" cols = "40" rows = "5">
</textarea></dd>
<dd><input class = "text_area" type="submit" value="Register" name="submit"></dd>
</fieldset>
</div>
</form>
Script:
<?php
$name=$_POST['name'];
$email=$_POST['email'];
$comments=$_POST['comments'];
$submit=$_POST['submit'];
$to = 'email@email.com';
$subject = '$name . "Commented on your Blogging site" . "<br>" . "His email address is:" . $email .
"He had this to say:" . $comments';
$message = 'Comment from viewer';
if(isset($name, $email, $comments))
{
$sent = mail($to, $subject, $message);
}
else
{
echo 'Please fill out all of the fields';
}
exit;
if($sent)
{
echo 'Mail sent successfully';
}
else
{
echo 'Mail Error';
}
?>