Advertisement
Guest User

Untitled

a guest
Jan 13th, 2017
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. <title> Schedule an Appointment - Name </title>
  2. <link rel="stylesheet" type="text/css" href="public/styles.css">
  3. <meta name="viewport" content="width=device-width, initial-scale=1">
  4. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  5. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  6. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  7. <script src="public/script.js"></script>
  8.  
  9. <ul id="nav">
  10. <li><a href="page.html"> Home </a><br>
  11. <br>
  12. <li><a class="active" href=""> Appointment </a> <br>
  13. <br>
  14. <li><a href="specsPage.html"> Build </a> <br>
  15. <br>
  16. <li><a href="contactPage.html"> Contact </a> <br>
  17. <br>
  18. </ul>
  19.  
  20. <div id="schedulePage">
  21. <h4> Schedule an Appointment </h4>
  22.  
  23. <div id="fullForm">
  24.  
  25. <form id="appt" action="public/mail_handler.php" method="POST">
  26.  
  27. First Name: <input type="text" name="firstname" placeholder="First Name..."> <br>
  28. <br>
  29. Last Name: <input type="text" name="lastname" placeholder="Last Name..."> <br>
  30. <br>
  31. Email: <input type="text" name="email" placeholder="Email..."> <br>
  32. <br>
  33. Phone Number: <input type="text" name="phone" placeholder="Callback Number..."> <br>
  34. <br>
  35. <input type="submit" name="submit" value="Submit">
  36.  
  37. </form>
  38.  
  39. </div>
  40. </div>
  41.  
  42. <?php
  43.  
  44. $firstname = $_REQUEST['firstname'] ;
  45. $lastname = $_REQUEST['lastname'] ;
  46. $email = $_REQUEST['email'] ;
  47. $phone = $_REQUEST['phone'] ;
  48.  
  49.  
  50. require("public/phpmailer/PHPMailerAutoload.php");
  51.  
  52. $mail = new PHPMailer();
  53.  
  54. $mail->IsSMTP();
  55.  
  56. $mail->Host = "localhost:4000";
  57.  
  58. $mail->SMTPAuth = true;
  59.  
  60. $mail->Username = "send_from_PHPMailer@name"; // hidden
  61. $mail->Password = "pass"; // hidden
  62.  
  63. $mail->From = $email;
  64.  
  65. $mail->AddAddress("test@gmail.com", "Test Account");
  66.  
  67. // set word wrap to 50 characters
  68. $mail->WordWrap = 50;
  69. // set email format to HTML
  70. $mail->IsHTML(true);
  71.  
  72. $mail->Subject = "Your appointment details.";
  73.  
  74.  
  75. if(!$mail->Send())
  76. {
  77. echo "Message could not be sent. <p>";
  78. echo "Mailer Error: " . $mail->ErrorInfo;
  79. exit;
  80. }
  81.  
  82. echo "Message has been sent";
  83. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement