Advertisement
Guest User

Untitled

a guest
Mar 16th, 2016
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.60 KB | None | 0 0
  1. if(isset($_POST['submit'])) {
  2.  
  3. $message =
  4. 'Full Name: '.$_POST['name'].'<br />
  5. Email: '.$_POST['email'].'<br />
  6. Phone: '.$_POST['phoneNumber'].'<br />
  7. Service: '.$_POST['services'].'<br />
  8. Message: '.$_POST['messageArea'].'
  9. ';
  10.  
  11. require "phpmailer/PHPMailerAutoload.php";
  12.  
  13. $mail = new PHPMailer();
  14.  
  15. $mail->IsSMTP();
  16. $mail->SMTPAuth = true;
  17. $mail->SMTPSecure = "ssl";
  18. $mail->Host = "smtp.gmail.com";
  19. $mail->Port = 465;
  20. $mail->Encoding = '7bit';
  21.  
  22. $mail->Username = "xxxxxx@gmail.com";
  23. $mail->Password = "xxxxxxxxx";
  24.  
  25. $mail->SetFrom($_POST['email'], $_POST['name']);
  26. $mail->AddReplyTo($_POST['email'], $_POST['name']);
  27. $mail->Subject = "Message from TheRejuviner.com";
  28. $mail->MsgHTML($message);
  29.  
  30. $mail->AddAddress("xxxxxx@gmail.com", "xxxx");
  31. $result = $mail->Send();
  32. $message = $result ? 'Successfully Sent!' : 'Sending Failed';
  33. unset($mail);
  34.  
  35. }
  36.  
  37. ?>
  38.  
  39. <!DOCTYPE html>
  40. <html lang="en">
  41.  
  42. <body>
  43. <div>
  44.  
  45. <!-- ######### MAIN CONTENT AREA######### -->
  46. <div>
  47.  
  48. <div>
  49. <h1>Contact Form</h1>
  50.  
  51. <form name="contact_form" method="post" action="" class="form_holder">
  52.  
  53. <div>
  54. <!-- ###NAME LABEL AND FIELD### -->
  55. <label for="name"><span class="star">&lowast;</span>Your Name&nbsp;:&nbsp;
  56.  
  57. <input name="name" type="text" id="name_field" placeholder="e.g. John Doe..." title="Enter your full name." autocomplete="off" autofocus>
  58.  
  59. </label>
  60. <!-- ###END NAME LABEL AND FIELD### -->
  61. </div>
  62.  
  63. <div>
  64. <!-- ###EMAIL LABEL AND FIELD### -->
  65. <label for="email"><span class="star">&lowast;</span>Your Email&nbsp;:&nbsp;&nbsp;
  66.  
  67. <input name="email" type="text" id="email_field" placeholder="e.g. johndoe@email.com..." title="Enter your email address." autocomplete="off" autofocus>
  68. </label>
  69. <!-- ###END EMAIL LABEL AND FIELD### -->
  70. </div>
  71.  
  72. <div>
  73. <!-- ###PHONE NUMBER LABEL AND FIELD### -->
  74. <label for="phoneNumber"><span class="star">&lowast;</span>Your Phone&nbsp;:&nbsp;
  75.  
  76. <input name="phoneNumber" type="text" id="phone_number_field" placeholder="e.g. (777)333-4444..." title="Enter your phone number." autocomplete="off" autofocus>
  77. </label>
  78. <!-- ###END PHONE NUMBER LABEL AND FIELD### -->
  79. </div>
  80.  
  81. <div class="contact_input">
  82. <!-- ###SERVICES LABEL AND FIELD### -->
  83. <label for="services"><span class="star">&lowast;</span>Select Service&nbsp;:&nbsp;
  84.  
  85. <select name="services" id="services" title="Select which service you are inquiring for" autofocus>
  86. <option value="Empty">...</option>
  87. <option value="Reiki">Reiki Session</option>
  88. <option value="Holographic Memory Resolution">HMR Session</option>
  89. <option value="Akashic Records">Akashic Records Session</option>
  90. <option value="Full Package">Full Package Session</option>
  91. <option value="None">None</option>
  92.  
  93. </select>
  94.  
  95. </label>
  96. <!-- ###END SERVICES LABEL AND FIELD### -->
  97. </div>
  98.  
  99. <div>
  100. <!-- ###PHONE NUMBER LABEL AND FIELD### -->
  101. <label for="message"><span class="star star_text">&lowast;</span>Your message&nbsp;:
  102.  
  103. <textarea id="message_area" name="messageArea" autofocus></textarea>
  104. </label>
  105. <!-- ###END PHONE NUMBER LABEL AND FIELD### -->
  106. </div>
  107.  
  108. <!-- ###SUBMIT BUTTON### -->
  109. <div>
  110. <input type="submit" id="submit" name="submit" value="submit" autofocus required />
  111. </div>
  112. <!-- ###END SUBMIT BUTTON### -->
  113.  
  114. </form>
  115. <p><?php if(!empty($message)) echo $message; ?></p>
  116. </div>
  117.  
  118.  
  119. </div>
  120.  
  121. </div>
  122.  
  123.  
  124. </body>
  125.  
  126. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement