Guest User

Untitled

a guest
Jul 29th, 2018
467
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. <?php
  2. require 'PHPMailerAutoload.php';
  3. $contactEmail = $_POST['Email'];
  4. $contactName = $_POST['Name'];
  5. $contactNumber = $_POST['Cell'];
  6. $contactLocation = $_POST['Location'];
  7. $contactMessage = $_POST['Message'];
  8. $mail = new PHPMailer(true);
  9. $mail->isSMTP();
  10. $mail->SMTPDebug = 2;
  11. $mail->SMTPKeepAlive = true;
  12. $mail->Mailer = “smtp”;
  13. $mail->Host = 'smtp.lovecharmking.com';
  14. $mail->SMTPAuth = true;
  15. $mail->Username = 'xxxx';
  16. $mail->Password = 'xxx';
  17. $mail->SMTPSecure = 'TLS';
  18. $mail->Port = 587;
  19. $mail->setFrom('help@lovecharmking.com', $contactName);
  20. $mail->addAddress('papazeddy@gmail.com', 'Zeddy');
  21. $mail->addReplyTo($contactEmail);
  22. $mail->isHTML(true);
  23. $email_body = "";
  24. $email_body .= "<b>Name: </b> " . $contactName . "</span>";
  25. $email_body .= "<b>Email Address: </b>" . $contactEmail . "</b";
  26. $email_body .= "<p>Phone Number: " . $contactNumber . "</p>";
  27. $email_body .= "<p><b>Location: </b>" . $contactLocation . "</p>";
  28. $email_body .= "<p><b>Message: </b>" . $contactMessage . "</p>";
  29. $mail->Subject = 'Contact Form';
  30. $mail->Body = $email_body;
  31. if(!$mail->send()) {
  32. echo 'Message could not be sent.';
  33. echo 'Mailer Error: ' . $mail->ErrorInfo;
  34. } else {
  35. echo 'Message has been sent';
  36. }
Add Comment
Please, Sign In to add comment