コード例 #1
0
    dre_msg(T_('Return path processing feature is not enabled.'), true);
    return 2;
    // error
}
if (!extension_loaded('imap')) {
    dre_msg(T_('The php_imap extension is not available to PHP on this server. Please load it in php.ini or ask your hosting provider to do so.'), true);
    return 2;
    // error
}
load_funcs('_core/_param.funcs.php');
load_class('_ext/mime_parser/rfc822_addresses.php', 'rfc822_addresses_class');
load_class('_ext/mime_parser/mime_parser.php', 'mime_parser_class');
if (isset($GLOBALS['files_Module'])) {
    load_funcs('files/model/_file.funcs.php');
}
if (!($mbox = dre_connect(true))) {
    // We couldn't connect to the mail server
    return 2;
    // error
}
// Read messages from server
dre_msg(T_('Reading messages from server'), true);
$imap_obj = imap_check($mbox);
dre_msg(sprintf(T_('Found %d messages'), intval($imap_obj->Nmsgs)), true);
if ($imap_obj->Nmsgs == 0) {
    dre_msg(T_('There are no messages in the mailbox'), true);
    imap_close($mbox);
    return 1;
    // success
}
// Create posts
コード例 #2
0
ファイル: email.ctrl.php プロジェクト: ldanielz/uesp.blog
 load_funcs('cron/model/_decode_returned_emails.funcs.php');
 load_class('_ext/mime_parser/rfc822_addresses.php', 'rfc822_addresses_class');
 load_class('_ext/mime_parser/mime_parser.php', 'mime_parser_class');
 if (isset($GLOBALS['files_Module'])) {
     load_funcs('files/model/_file.funcs.php');
 }
 global $dre_messages;
 switch ($action) {
     case 'test_1':
         if ($mbox = dre_connect()) {
             // Close opened connection
             imap_close($mbox);
         }
         break;
     case 'test_2':
         if ($mbox = dre_connect()) {
             // Read messages from server
             dre_msg('Reading messages from server');
             $imap_obj = imap_check($mbox);
             dre_msg('Found ' . $imap_obj->Nmsgs . ' messages');
             if ($imap_obj->Nmsgs > 0) {
                 // We will read only 1 message from server in test mode
                 dre_process_messages($mbox, 1);
             } else {
                 dre_msg(T_('There are no messages in the mailbox'));
             }
             imap_close($mbox);
         }
         break;
     case 'test_3':
         param('test_error_message', 'raw', '');