Changeset 25384 for trunk/include
- Timestamp:
- Nov 7, 2013, 10:04:40 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_mail.inc.php
r25372 r25384 679 679 if ($content_type == 'text/html') 680 680 { 681 if ($template->smarty->template _exists('global-mail-css.tpl'))681 if ($template->smarty->templateExists('global-mail-css.tpl')) 682 682 { 683 683 $template->set_filename('global-css', 'global-mail-css.tpl'); … … 685 685 } 686 686 687 if ($template->smarty->template _exists('mail-css-'. $args['theme'] .'.tpl'))687 if ($template->smarty->templateExists('mail-css-'. $args['theme'] .'.tpl')) 688 688 { 689 689 $template->set_filename('css', 'mail-css-'. $args['theme'] .'.tpl'); … … 738 738 $template->set_template_dir($tpl['dirname'] .'/'. $content_type); 739 739 } 740 if ($template->smarty->template _exists($tpl['filename'] .'.tpl'))740 if ($template->smarty->templateExists($tpl['filename'] .'.tpl')) 741 741 { 742 742 $template->set_filename($tpl['filename'], $tpl['filename'] .'.tpl'); … … 822 822 { 823 823 $ret = $mail->send(); 824 if (!$ret and is_admin())824 if (!$ret and (!ini_get('display_errors') || is_admin())) 825 825 { 826 826 trigger_error('Mailer Error: ' . $mail->ErrorInfo, E_USER_WARNING); 827 } 828 if ($conf['debug_mail']) 829 { 830 pwg_send_mail_test($ret, $mail, $args); 827 831 } 828 832 } … … 878 882 * @return boolean $result 879 883 */ 880 function pwg_send_mail_test($ result, $to, $args, $mail)884 function pwg_send_mail_test($success, $mail, $args) 881 885 { 882 886 global $conf, $user, $lang_info; … … 885 889 if (mkgetdir($dir, MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR)) 886 890 { 887 $filename = $dir.'/mail.'.stripslashes($user['username']).'.'.$lang_info['code'].' .'.$args['theme'].'-'.date('YmdHis');891 $filename = $dir.'/mail.'.stripslashes($user['username']).'.'.$lang_info['code'].'-'.date('YmdHis').($success ? '' : '.ERROR'); 888 892 if ($args['content_format'] == 'text/plain') 889 893 { … … 896 900 897 901 $file = fopen($filename, 'w+'); 898 fwrite($file, implode(', ', $to) ."\n"); 899 fwrite($file, $mail->Subject ."\n"); 900 fwrite($file, $mail->createHeader() ."\n"); 901 fwrite($file, $mail->createBody()); 902 if (!$success) 903 { 904 fwrite($file, "ERROR: " . $mail->ErrorInfo . "\n\n"); 905 } 906 fwrite($file, $mail->getSentMIMEMessage()); 902 907 fclose($file); 903 908 } 904 905 return $result;906 }907 908 if ($conf['debug_mail'])909 {910 add_event_handler('before_send_mail', 'pwg_send_mail_test', EVENT_HANDLER_PRIORITY_NEUTRAL+10, 4);911 909 } 912 910
Note: See TracChangeset
for help on using the changeset viewer.