Has anyone sent mail from a PHP page to a remote user?
What is the correct syntax for the PHP.INI file to get mail to be sent?
http://www.php.net/manual/en/function.mail.php is the help site for the mail command.
Here is a sample that might work.
<html>
<head><title>Feedback</title></head>
<body>
<?php
// Handle POST method.
if ($_POST)
{
$name = $_POST['name'];
$email = $_POST['email'];$comments = $_POST['comments'];
// Compose simple text message:
$message = "Message from $name ($email)\n\nComments:\n\n$comments";
// Send message to billir@hotmail.com
mail("billir@hotmail.com", "Feedback", $message);
// Thank the generous user
echo "<h1>Cheers!</h1>\n";
}
else
{
?>
<h1>Feedback</h1>
<form action="<?= $PHP_SELF ?>" method="post">
<p>Name: <input type="text" name="name" /></p>
<p>Email: <input type="text" name="email" /></p>
<p>Comments:</p>
<p><textarea name="comments"></textarea></p>
<p><input type="submit" value="Send!" /></p>
</form>
<?php
}
?>