Link to home
Start Free TrialLog in
Avatar of CEORACE
CEORACEFlag for United States of America

asked on

Server 2012 IIS 8 SMTP

I need a php form to send mail from a contact form.  I have the forms, and I have tried setting up SMTP service on 2012 R2.  I have had no joy.  Is there a chance someone has a walk through so I could find the likely one check box I have missed along the way?

<!-- Contact Form -->
                                          <form method="post" action="mail.php">
                                                <div class="row 50%">
                                                      <div class="6u 12u(mobile)"><input type="text" name="name" placeholder="Name" /></div>
                                                      <div class="6u 12u(mobile)"><input type="email" name="email" placeholder="Email" /></div>
                                                </div>
                                                <div class="row 50%">
                                                      <div class="12u"><textarea name="message" placeholder="Message" rows="6"></textarea></div>
                                                </div>
                                                <div class="row">
                                                      <div class="12u">
                                                            <ul class="actions">
                                                                  <li><input type="submit" value="Send Message" /></li>
                                                            </ul>
                                                      </div>
                                                </div>
                                          </form>



Mail.php
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent="From: $name \n Message: $message";
$recipient = "randy@raceaz.com";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("C'mon ya Dummy, figure it out - Error!");
echo "Thank You!";
?>
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial