Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('wp_mail_failed', 'log_mailer_errors', 10, 1);
- function log_mailer_errors($mailer){
- $fn = ABB_FRAMEWORK . 'mail.log'; // say you've got a mail.log file in your server root
- $fp = fopen($fn, 'a');
- fputs($fp, "Mailer Error: " . json_encode($mailer->get_error_messages()) ."\n");
- fclose($fp);
- }
- add_action( 'phpmailer_init', 'mailer_config', 10, 1);
- function mailer_config(PHPMailer $mailer){
- $mailer->IsSMTP();
- $mailer->SMTPAuth = true;
- // $mailer->SMTPSecure = 'ssl';
- $mailer->Host = 'host';
- $mailer->Port = 465;
- $mailer->SMTPDebug = 2;
- $mailer->Username = 'xxxxx';
- $mailer->Password = 'xxxxx';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement