title: Sending HTML email, via PHP form
body: <p>I am trying to send my website visitors and email with some directions and tips before they show up to my studio via PHP form mailer. ( i am simplifying some of the form fields )</p>
  
  <p>However the HTML formatting is not working correctly.... did i not declare the mime type of charset correctly?</p>
  
  <pre><code>&lt;?php 
  
              if (isset($_POST['submit'])) { 
  
              //if (empty ($_POST['name']) || empty($_POST['email'])) 
              //{
              //echo"&lt;div class='error'&gt;Error&lt;br /&gt;You did not fill in a required field, please review your form and correct the missing information. &lt;a class='close' href='#'&gt;close&lt;/a&gt;&lt;/div&gt;";
              //}
  
              $name = $_POST['name'];
              $email = $_POST['email'];
              $email2 = $_POST['email2'];
              //A bunch of other fields are here
  
              //Additional Headers
  
              $headers  = 'MIME-Version: 1.0' . "\r\n";
              $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  
  
              //$yoursite = "My Site";
              //$youremail = $email;
  
              $subject = "Website Form";
              $message = "
              $name would like you to contact them about your service.
              Contact PH:  $phone
              Email:  $email
              Legal Guardian: $legal              
              //more stuff here
              ";
  
  
              $subject2 = "Directions and Information";
  
                              $message2 = "&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;
              $message2 .= "&lt;h1&gt;Directions&lt;/h1&gt;
  
              &lt;p&gt;text&lt;/p&gt;
  
              &lt;p&gt;&lt;a href='http://example.com/schedules'&gt;Click here&lt;/a&gt;
  
              &lt;h2&gt;How Do I find your Photo Studio?&lt;/h2&gt;
  
              &lt;h2&gt;What do I have to bring with me?&lt;/h2&gt;
              &lt;/p&gt;";
  
              $message2 .= "&lt;/body&gt;&lt;/html&gt;";
  
  
  
              $email3 = "me@mysite.com";
              $email4 = "mysite@gmail.com";
  
  
  
  
              //This email sends their details to me from the visitor
              mail($email3, $subject, $message, "From: $email");
  
  
                              //This email sends directions to the visitor from me
              mail($email, $subject2, $message2, "From: $email4");
  
              echo"&lt;div class='thankyou'&gt;Thank you for contacting us,&lt;br /&gt; we will respond as soon as we can.&lt;/div&gt;";
  
  
              }
              ?&gt;
  </code></pre>