tribulant

phpMailer DKIM

Feb 8th, 2013
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.15 KB | None | 0 0
  1. <?php
  2.  
  3. require_once('class.phpmailer.php');
  4. $mail             = new PHPMailer(); // defaults to using php "mail()"
  5. //$body             = file_get_contents('contents.html');
  6. //$body             = eregi_replace("[\]",'',$body);
  7. $body = "This is my body";
  8. $myaddress = "[email protected]";
  9. $mail->AddReplyTo("[email protected]","Newsletter plugin");
  10. $mail->SetFrom("[email protected]","Newsletter plugin");
  11. $mail->AddReplyTo("[email protected]","Newsletter plugin");
  12. $address = "[email protected]";
  13. $mail->AddAddress($address);
  14. $mail -> Encoding = "8bit";
  15. $mail->Subject    = "PHPMailer Test Subject";
  16. //$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
  17. $mail -> MsgHTML($body);
  18. $mail -> Body = $body;
  19. $mail -> DKIM_private = ".htkeyprivate";
  20. $mail -> DKIM_domain = "wpplugins.biz";
  21. $mail -> DKIM_selector = "newsletters";
  22. //$mail->AddAttachment("images/phpmailer.gif");      // attachment
  23. //$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
  24. if(!$mail->Send()) {
  25.   echo "Mailer Error: " . $mail->ErrorInfo;
  26. } else {
  27.   echo "Message sent!";
  28. }
  29.    
  30.  
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment