. /** * Show Contents of Email Queue in Mantis Database * This allows an administrator to clear 'stuck' mails * * @package MantisBT * @copyright Copyright 2000 - 2002 Kenzaburo Ito - kenito@300baud.org * @copyright Copyright 2002 MantisBT Team - mantisbt-dev@lists.sourceforge.net * @link http://www.mantisbt.org */ require_once( dirname( __DIR__ ) . '/core.php' ); access_ensure_global_level( config_get_global( 'admin_site_threshold' ) ); layout_page_header(); layout_admin_page_begin(); print_admin_menu_bar( 'email_queue.php' ); ?>
'; email_send_all(); echo 'Done'; } else if( $f_to == 'sendordelall' ) { echo 'Sending or deleting emails...
'; email_send_all( true ); echo 'Done'; } else { $t_email_data = email_queue_get( (int)$f_to ); # check if email was found. This can fail if another request picks up the email first and sends it. echo 'Sending email...
'; if( $t_email_data !== false ) { if( !email_send( $t_email_data ) ) { echo 'Email Not Sent - Deleting from queue
'; email_queue_delete( $t_email_data->email_id ); } else { echo 'Email Sent
'; } } else { echo 'Email not found in queue
'; } } } if( $f_mail_test ) { lang_push( 'english' ); $t_email_data = new EmailData; $t_email_data->email = config_get_global( 'webmaster_email' ); $t_window_title = config_get( 'window_title' ); $t_email_data->subject = '[' . $t_window_title . '] Testing Email Notifications'; $t_email_data->body = 'Your PHP mail settings appear to be correctly set.'; $t_email_data->metadata['charset'] = 'utf-8'; $t_result = email_send( $t_email_data ); if( !$t_result ) { echo '
'; print_icon( 'fa-times', 'ace-icon fa-lg' ); echo 'Testing Mail - '; echo ' PROBLEMS SENDING MAIL TO: ' . config_get_global( 'webmaster_email' ) . '. Please check your php/mail server settings.'; echo '
'; } else { echo '
'; print_icon( 'fa-check', 'ace-icon fa-lg' ); echo 'Testing Mail - '; echo ' email sent successful.'; echo '
'; } } $t_ids = email_queue_get_ids(); if( count( $t_ids ) > 0 ) { ?>

Email Queue

Send Or Delete
email_id; ?> email; ?> submitted );?> $t_row->email_id ) ); ?>
'; echo '
'; html_button( 'email_queue.php', 'Send All', array( 'send' => 'all') ); echo '
'; echo '
'; html_button( 'email_queue.php', 'Send Or Delete All', array( 'send' => 'sendordelall') ); echo '
'; echo '
'; } else { echo '

Email Queue Empty

'; } ?>

Testing Email

You can test the ability for MantisBT to send email notifications with this form. Just click "Send Mail". If the page takes a very long time to reappear or results in an error then you will need to investigate your php/mail server settings (see PHPMailer related settings in your config/config_inc.php, if they don't exist, copy from config_defaults_inc.php).

Note that errors can also appear in the server error log.

More help can be found at the PHP website if you are using the mail() PHPMailer sending mode.

Email Address (from `$g_webmaster_email`):