I have tried to set-up an email.html and an action.php so that someone can send an email from a website. Here is the code in email.html
<form action="./action.php" method="post">
<p>Your Name</p>
<p><input type="text" name="name" /></p>
<p>Email</p>
<p><input type="text" name="email" /></p>
<p>Services</p>
<p><input type="text" name="service" /></p>
<p>Requests</p>
<p><textarea rows="8" cols="32" name="comment"></textarea></p>
<p><input type="submit" value="Send" /></p>
</form>
In action.php I have
<?php
$to = "foo@outlook.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "foo2@gmail.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
The information entered in email.html successfully load into action.php, but nothing is received in my Outlook inbox from the email method. Am I missing something?