Advertisement
Guest User

Untitled

a guest
Dec 13th, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. add_action('wp_mail_failed', 'log_mailer_errors', 10, 1);
  2. function log_mailer_errors($mailer){
  3. $fn = ABB_FRAMEWORK . 'mail.log'; // say you've got a mail.log file in your server root
  4. $fp = fopen($fn, 'a');
  5. fputs($fp, "Mailer Error: " . json_encode($mailer->get_error_messages()) ."\n");
  6. fclose($fp);
  7. }
  8.  
  9. add_action( 'phpmailer_init', 'mailer_config', 10, 1);
  10. function mailer_config(PHPMailer $mailer){
  11. $mailer->IsSMTP();
  12. $mailer->SMTPAuth = true;
  13. // $mailer->SMTPSecure = 'ssl';
  14. $mailer->Host = 'host';
  15. $mailer->Port = 465;
  16. $mailer->SMTPDebug = 2;
  17. $mailer->Username = 'xxxxx';
  18. $mailer->Password = 'xxxxx';
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement