Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Display errors
- */
- if ( ! function_exists('debug_wpmail')) :
- function debug_wpmail( $result = false ) {
- if ( ! $result ) {
- global $ts_mail_errors;
- global $phpmailer;
- if ( ! isset($ts_mail_errors) )
- $ts_mail_errors = array();
- if ( isset($phpmailer) ) {
- $ts_mail_errors[] = $phpmailer->ErrorInfo;
- }
- print_r('<pre>');
- print_r($ts_mail_errors);
- print_r('</pre>');
- }
- }
- endif;
- /**
- * Usage
- */
- $res = wp_mail($to, $subject, $message);
- debug_wpmail($res); // Will print_r array of errors
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement