Ok, so I have a faily simple feedback form set up. This form takes the user's name, email, and message - and then sends them all to a specified email address. As far as I know, the code is fine - it's just that nothing is being sent to my inbox, and I am wondering if that has to do with the server I am hosted on... or if that my code is actually wrong.
Here is the form:
Code: Select all
<html>
<head>
<title>Feedback</title>
</head>
<body>
<h1>Feedback</h1>
<p>Please tell us what you think.</p>
<form method=post action="processfeedback.php">
Your name: <br />
<input type=text name="name" size=40><br />
Your email address: <br />
<input type=text name="email" size=40><br />
Your feedback:<br />
<textarea name="feedback" rows=5 cols=30>
</textarea><br />
<input type=submit value="Send feedback">
</form>
</body>
</html>Code: Select all
<html>
<head>
<title>Feedback Submitted</title>
</head>
<body>
<?php>
//short variable names
$name = $_POST['name'];
$email = $_POST['email'];
$feedback = $_POST['feedback'];
//mail() function variables
$toaddress = 'mabufo@gmail.com';
$subject = 'Php form test';
$mailcontent = 'Customer Name: '.$name. "\n"
.'Customer email: '.$email. "\n"
."Customer Feedback: \n".$feedback."\n";
$fromaddress = 'From: webserver@example.com';
//mails the form results
mail($toaddress, $subject, $mailcontent, $fromaddress);
?>
<h1>Feedback Submitted.</h1>
<p>Your feedback has been shipped as is:</p><br />
<?php
echo n12br($mailcontent);
?>
</body>
</html>