Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require("PHPMailer/class.PHPMailer.php");
- require 'PHPMailer/PHPMailerAutoload.php';
- $mail = new PHPMailer;
- //$mail->SMTPDebug = 3; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'localhost'; // Specify main and backup SMTP servers
- $mail->SMTPAuth = false; // Enable SMTP authentication
- //$mail->Username = ''; // SMTP username
- //$mail->Password = ''; // SMTP password
- //$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
- $mail->Port = 25; // TCP port to connect to
- $mail->setFrom($email, $sendername);
- $mail->addAddress('test@gmail.com', 'Joe User'); // Add a recipient
- //$mail->addAddress('ellen@example.com'); // Name is optional
- $mail->addReplyTo($email, $sendername);
- $mail->addCC('test@testmail.com');
- //$mail->addBCC('bcc@example.com');
- //$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
- //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = 'Test Mail';
- $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;
- $mail->Body = $comment;
- $mail->AltBody = $comment;
- if($sendernameErrFlag == 0 && $emailErrFlag == 0 && $subjectErrFlag == 0 && $commentErrFlag == 0) {
- $mail->send();
- echo "hi";
- $pagelink = the_permalink();
- echo '<div id="popup1" class="overlay">
- <div class="popup">
- <a class="close" href="' . $pagelink . '">×</a>
- <div class="content">
- Message sent successfully!!!
- </div>
- </div>
- </div>';
- //echo '<script>alert("Message sent successfully!!!");</script>';
- } else {
- $sendernameErrFlag = $emailErrFlag = $subjectErrFlag = $commentErrFlag = 2;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement