1. <?
  2. $email = $_POST['email'];
  3. $questions = $_POST['myQuestions'];
  4. // subject
  5. $subject = 'Request for Information';
  6.  
  7. // HTML message
  8. $message = '
  9. <html>
  10. <head>
  11. <title>' . $email . ' sent you a message.</title>
  12. </head>
  13. <body>
  14. <p style="font-size: 19px;">' . $email. '</p>
  15. <p style="font-size: 19px;"> '. $questions .'</p>
  16. </body>
  17. </html>
  18. ';
  19.  
  20. // To send HTML mail, the Content-type header must be set
  21. $headers = 'MIME-Version: 1.0' . "\r\n";
  22. $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  23.  
  24. // Additional headers
  25. $headers .= 'To: <' . $_POST['email'] . '>' . "\r\n";
  26. $headers .= 'From: My Web Site <justaguy@mywebsite.com>' . "\r\n";
  27.  
  28. // Mail it
  29. mail($to, $subject, $message, $headers);
  30.  
  31. //Send them back to the form page with a success message.
  32. // From here is the html to the success page after e-mail was $theResults = <<< EOD
  33. <html>
  34. <head>
  35. <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  36. <title>My Web Site/contact</title>
  37. <link href="main.css" rel="stylesheet" type="text/css" />
  38. </head>
  39.  
  40. <body>
  41.  
  42. <div id="page-wrap" class="group">
  43.  
  44. <div id="header">
  45.  
  46. <div id="logo"></div>
  47.  
  48. <h1>My Web Site</h1>
  49.  
  50. <p>Yada yada</p>
  51.  
  52.  
  53.  
  54. </div><!--END of header-->
  55.  
  56.  
  57.  
  58. <div id="main-content">
  59.  
  60. <div id="results">
  61. <p>Your request for additional information has successfully been forwarded.</p>
  62. <p>Thank you for your interest in My Web Site.</p>
  63. <p> You can expect a prompt response.</p>
  64.  
  65.  
  66. </div>
  67.  
  68.  
  69. </div><!--END of main-content-->
  70.  
  71. <div id="sidebar">
  72.  
  73. <div id="navigation">
  74.  
  75. <ul>
  76. <li><a href="http://www.mysite.com/">Home<span></span></a></li>
  77. <li><a href="http://www.mysite.com/about.html">About<span></span></a></li>
  78. <li><a href="http://www.mysite.com/on-design.html">On Design<em>(my blog)</em><span></span></a></li>
  79. <li><a href="http://www.mysite.com/quote.html">Get A Quote<span></span></a></li>
  80. <li><a href="http://www.mysite.com/contact.html">Contact Me <span></span></a></li>
  81. </ul>
  82.  
  83. </div><!--END of navigation-->
  84.  
  85. </div><!--END of sidebar-->
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94. <div id=footer>
  95.  
  96. <p>&copy; 2011 My Site / All Rights Reserved.</p>
  97.  
  98. <div id="badge"></div>
  99.  
  100.  
  101. </div><!--END of footer-->
  102.  
  103. </div><!--END of page-wrap-->
  104.  
  105. </body>
  106. </html>
  107. EOD;
  108. echo "$theResults";
  109.  
  110. ?>