I’m having a little trouble with my contact form. The vars are working properly and everything, only problem is the mail() won’t mail. It works for my wordpress install and another script I use, so I’m not sure why it is not working here.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Atlantor - Redefining the way you RP</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="generator" content="Atlantor - DEV" />
<style type="text/css" media="all">@import "/css/global.css";</style>
</head>
<body>
<?
if($_POST) {
$to = "w1se17@gmail.com";
$from = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['comments'];
if(mail($to, $subject, $message)) {
echo "Mail sent.<br />";
echo "<a href=\"index.php\" title=\"Dev Homepage\">Back to dev</a>";
echo "<br />" . $to . "<br />" . $from . "<br />" . $subject . "<br />" . $message;
} else {
echo "Mail could not be sent. <br />";
echo "<a href=\"index.php\" title=\"Dev Homepage\">Back to dev</a>";
}
} else {
?>
<h1>Contact</h1>
If you'd like to leave some feedback, or report problems/bugs, please fill out this form and submit it. We will get back
to you as soon as we can.
<form method="post" action="contact.php">
<table width="400">
<tr><td width="100"> Your E-Mail:</td> <td><input type="text" name="email" size="60" /></td></tr>
<tr><td>Subject:</td> <td><input type="text" name="subject" size="60" /></td></tr>
<tr><td valign="top">Comments:</td> <td><textarea name="comments" rows="10" cols="30"></textarea></td></tr>
<tr><td><input type="submit" name="submit" value="submit" /></td></tr>
</table>
</form>
<?
}
?>
</body>
</html>
I’ve tried many params for mail(). Any help is appreciated :). Thanks in advance. I’m going to add more security once I figure out why mail() isn’t mailing, so it’s pretty basic right now.