Guest User

Untitled

a guest
Sep 12th, 2018
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1. $mail->ClearAllRecipients();
  2. $mail->setFrom('mail@domain.com', 'Mailer');
  3. $mail->addAddress('mail@info.com', 'Joe User');
  4. $mail->addAddress('mail@info.com');
  5. $mail->addReplyTo('info@example.com', 'Information');
  6.  
  7. [P54] => Array
  8. (
  9. [0] => Array
  10. (
  11. [id] => 54
  12. [type] => Package
  13. [values] => Array
  14. (
  15. [0] => Array
  16. (
  17. [name] => Farmaan Mansoori
  18. [email] => info@demo.com
  19. [phone] => 425698745
  20. [date_book] => 2018-09-20
  21. [adults] => 1
  22. [child] => 0
  23. [infant] => 0
  24. [room] => 0
  25. [suppliment] => no
  26. [hotel] => 3 Star
  27. [img] => London Paris.jpg
  28. [price] => Array
  29. (
  30. [0] => 3540
  31. [1] => 3100
  32. [2] => 2635
  33. [3] => 1
  34. [4] => 440
  35. )
  36.  
  37. [package_name] => london_paris
  38. [id] => 54
  39. [type] => Package
  40. )
  41.  
  42. )
  43.  
  44. )
  45.  
  46. )
  47.  
  48. use PHPMailerPHPMailerPHPMailer;
  49. use PHPMailerPHPMailerException;
  50. require 'vendor/autoload.php';
  51. $mail = new PHPMailer(true);
  52. try {
  53. $mail->SMTPDebug = 0;
  54. $mail->isSMTP();
  55. $mail->Host = 'smtp.gmail.com';
  56. $mail->SMTPAuth = true;
  57. $mail->Username = 'demo@gmail.com';
  58. $mail->Password = 'secret';
  59. $mail->SMTPSecure = 'tls';
  60. $mail->Port = 587;
  61.  
  62. //Recipients
  63. $mail->ClearAllRecipients();
  64. $mail->setFrom('dmeo@gmail.com', 'Mailer');
  65. $mail->addAddress('info@techyogiitsolutions.com', 'Joe User');
  66. $mail->addAddress('demo@gmail.com');
  67. $mail->addReplyTo('demo@example.com', 'Information');
  68. $mail->isHTML(true);
  69. $mail->Subject = "$pname Tour Booking Details";
  70. $mail->Body = "Hey! $name <br> You just booked a $pname . Here are some order details. <br>Adults: $adults <br> Child: $child <br> Infant: $infant <br> Hotel Type: $hotel <br> Single Rooms: $single <br> Total: $total.";
  71. $total = number_format($total);
  72. $mail->AltBody = "Hey! $name You just booked a $pname . Here are some order details.Adults: $adults Child: $child Infant: $infant Hotel Type: $hotel Single Rooms: $single Total: € $total.";
  73. $mail->send();
  74. $mail->ClearAddresses();
  75. } catch (Exception $e) {
  76. echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
  77. }
  78. $mail->ClearAllRecipients();
Add Comment
Please, Sign In to add comment