Advertisement
Guest User

Untitled

a guest
Jun 18th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. <?php
  2. require("PHPMailer/class.PHPMailer.php");
  3. require 'PHPMailer/PHPMailerAutoload.php';
  4. $mail = new PHPMailer;
  5. //$mail->SMTPDebug = 3; // Enable verbose debug output
  6. $mail->isSMTP(); // Set mailer to use SMTP
  7. $mail->Host = 'localhost'; // Specify main and backup SMTP servers
  8. $mail->SMTPAuth = false; // Enable SMTP authentication
  9. //$mail->Username = ''; // SMTP username
  10. //$mail->Password = ''; // SMTP password
  11. //$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
  12. $mail->Port = 25; // TCP port to connect to
  13. $mail->setFrom($email, $sendername);
  14. $mail->addAddress('test@gmail.com', 'Joe User'); // Add a recipient
  15. //$mail->addAddress('ellen@example.com'); // Name is optional
  16. $mail->addReplyTo($email, $sendername);
  17. $mail->addCC('test@testmail.com');
  18. //$mail->addBCC('bcc@example.com');
  19. //$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
  20. //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
  21. $mail->isHTML(true); // Set email format to HTML
  22. $mail->Subject = 'Test Mail';
  23. $comment = $comment . "rn<br/>" . "<br/>rnIP Address: " . $id . "<br/>rnUser Agent: " . $browser . "<br/>rnUser Agent: " . "<br/>rnReferrer: " . $referrer . "<br/>rnCity: " . $city . "<br/>rnRegion: " . $region . "<br/>rnCountry: " . $country . "<br/>rnLatitude: " . $latitude . "<br/>rnLongitude: " . $longitude;
  24. $mail->Body = $comment;
  25. $mail->AltBody = $comment;
  26. if($sendernameErrFlag == 0 && $emailErrFlag == 0 && $subjectErrFlag == 0 && $commentErrFlag == 0) {
  27. $mail->send();
  28. echo "hi";
  29. $pagelink = the_permalink();
  30. echo '<div id="popup1" class="overlay">
  31. <div class="popup">
  32. <a class="close" href="' . $pagelink . '">&times;</a>
  33. <div class="content">
  34. Message sent successfully!!!
  35. </div>
  36. </div>
  37. </div>';
  38. //echo '<script>alert("Message sent successfully!!!");</script>';
  39. } else {
  40. $sendernameErrFlag = $emailErrFlag = $subjectErrFlag = $commentErrFlag = 2;
  41. }
  42. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement