SHARE
TWEET

Untitled

a guest Dec 13th, 2016 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top