I tried setting up email.html and action.php so that someone could send an email from the 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 is successfully uploaded to the action.php file, but nothing was received in my Outlook inbox from the email method. Did I miss something?
source share