Advertisement
Guest User

email

a guest
Jan 1st, 2019
1,429
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. <?php
  2.  
  3. $name = $_POST['name'];
  4. $email = $_POST['email'];
  5. $telephone = $_POST['telephone'];
  6. $ticket = $_POST['ticket'];
  7. $address = $_POST['address'];
  8. $fb = $_POST['fb'];
  9.  
  10. function redirectToBillpliz($ticket)
  11. {
  12.  
  13. // To redirect form on a particular page
  14. header("Location: https://www.billplz.com/gsmmvspx5");
  15.  
  16. }
  17.  
  18. $bodyEmail = "
  19. <h4>Bengkel Excel Registration</h4>
  20.  
  21. <p>
  22. <table>
  23. <tr>
  24. <td>Name</td><td>{$name}</td>
  25. </tr>
  26. <tr>
  27. <td>Email</td><td>{$email}</td>
  28. </tr>
  29. <tr>
  30. <td>Tel No</td><td>{$telephone}</td>
  31. </tr>
  32. <tr>
  33. <td>Address</td><td>{$address}</td>
  34. </tr>
  35. <tr>
  36. <td>Link Fb</td><td>{$fb}</td>
  37. </tr>
  38. </table>
  39. </p>
  40. ";
  41.  
  42. $recipientEmail = 'diana@techharvest.asia';
  43.  
  44. require 'PHPMailer-master/PHPMailerAutoload.php';
  45. $mail = new PHPMailer();
  46. $mail->isSmtp();
  47. $mail->SMTPDebug = 1;
  48. $mail->SMTPAuth = true;
  49. $mail->SMTPSecure = 'SSL';
  50. $mail->Host = "mail.techharvest.asia";
  51. $mail->Port = "465";
  52. $mail->isHTML(true);
  53. $mail->Username = "diana@techharvest.asia";
  54. $mail->Password = "Hti4300155";
  55. $mail->From = "diana@techharvest.asia";
  56. $mail->Subject = "Bengkel Excel for Business";
  57. $mail->Body = $bodyEmail;
  58. $mail->addAddress($recipientEmail);
  59.  
  60. // Use for debug only
  61. if ($mail->SMTPDebug > 0) {
  62. if (!$mail->send()) {
  63. die("Mail Not Sent");
  64. } else {
  65. die("Mail Sent");
  66. }
  67. } else {
  68. $mail->send();
  69. redirectToBillpliz($ticket);
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement