Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. <?php
  2.  
  3. require 'class.phpmailer.php';
  4. if(isset($_POST['submit']))
  5. {
  6.  
  7.  
  8. $mail = new PHPMailer;
  9.  
  10. $mail->isSMTP();
  11.  
  12. $mail->Host = 'webmail.example.com';
  13.  
  14. $mail->Port = 587;
  15.  
  16. $mail->SMTPSecure = 'tls';
  17.  
  18. $mail->SMTPAuth = true;
  19.  
  20. $mail->Username = 'digital';
  21.  
  22. $mail->Password = '*******';
  23.  
  24. $mail->setFrom('digital@example.com', 'example');
  25.  
  26. $mail->addReplyTo('sales@example.com', 'example');
  27.  
  28. $mail->addAddress('sales@example.com', 'example');
  29.  
  30. $name_field = $_POST['name'];
  31. $mobile_field = $_POST['mobile'];
  32. $project_field = $_POST['project'];
  33. $utm_source_field = $_POST['USOURCE'];
  34. $utm_medium_field = $_POST['UMEDIUM'];
  35. $utm_campaign_field = $_POST['UCAMPAIGN'];
  36.  
  37. $mail->Subject = "Website Inquiry - $project_field";
  38. $mail->msgHTML($body);
  39.  
  40. if (!$mail->send()) {
  41. $error = "Mailer Error: " . $mail->ErrorInfo;
  42. ?><script>alert('<?php echo $error ?>');</script><?php
  43. }
  44. else {
  45. echo '';
  46. header("Location: thankyou.html");
  47. }
  48. }
  49. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement