. /** * @package MantisBT * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org * @copyright Copyright (C) 2002 - 2014 MantisBT Team - mantisbt-dev@lists.sourceforge.net * @link http://www.mantisbt.org */ /** * Mantis Core API's */ require_once( dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR . 'core.php' ); access_ensure_global_level( config_get_global( 'admin_site_threshold' ) ); $f_to = gpc_get( 'send', null ); if ( $f_to !== null ) { if ( $f_to == 'all' ) { echo "Sending emails...
"; 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
'; } } } $t_ids = email_queue_get_ids(); if( count( $t_ids ) > 0 ) { echo ''; foreach( $t_ids as $t_id ) { $row = email_queue_get( $t_id ); echo ''; } echo '
' . lang_get('id') . '' . lang_get('email') . '' . lang_get('timestamp') . 'Send Or Delete
' . $row->email_id . '' . $row->email . '' . date( config_get( 'complete_date_format' ), $row->submitted ) . '' , html_button( 'email_queue.php', 'Send Or Delete', array( 'send' => $row->email_id ) ) , '
'; } else { } html_button( 'email_queue.php', 'Send All', array( 'send' => 'all') ); html_button( 'email_queue.php', 'Send Or Delete All', array( 'send' => 'sendordelall') );