Example #1
0
/**
 * This function handles determining the protocol and fetching the mail
 * @return array
 */
function FetchMail($server = NULL, $port = NULL, $email = NULL, $password = NULL, $protocol = NULL, $offset = NULL, $test = NULL, $deleteMessages = true, $maxemails = 0, $email_tls = false)
{
    $emails = array();
    if (!$server || !$port || !$email) {
        EchoInfo("Missing Configuration For Mail Server");
        return $emails;
    }
    if ($server == "pop.gmail.com") {
        EchoInfo("MAKE SURE POP IS TURNED ON IN SETTING AT Gmail");
    }
    switch (strtolower($protocol)) {
        case 'smtp':
            //direct
            $fd = fopen("php://stdin", "r");
            $input = "";
            while (!feof($fd)) {
                $input .= fread($fd, 1024);
            }
            fclose($fd);
            $emails[0] = $input;
            break;
        case 'imap':
        case 'imap-ssl':
        case 'pop3-ssl':
            if (!HasIMAPSupport()) {
                EchoInfo("Sorry - you do not have IMAP php module installed - it is required for this mail setting.");
            } else {
                $emails = IMAPMessageFetch($server, $port, $email, $password, $protocol, $offset, $test, $deleteMessages, $maxemails, $email_tls);
            }
            break;
        case 'pop3':
        default:
            $emails = POP3MessageFetch($server, $port, $email, $password, $protocol, $offset, $test, $deleteMessages, $maxemails);
    }
    return $emails;
}
Example #2
0
function TestPOP3MessageFetch()
{
    print "**************RUNING IN TESTING MODE************\n";
    $config = get_postie_config();
    extract($config);
    $email = $test_email_account;
    $password = $test_email_password;
    return POP3MessageFetch($mail_server, $mail_server_port, $email, $password, $input_protocol, $time_offset, $test_email);
}
function TestPOP3MessageFetch()
{
    print "**************RUNING IN TESTING MODE************\n";
    $config = GetConfig();
    $email = $config["TEST_EMAIL_ACCOUNT"];
    $password = $config["TEST_EMAIL_PASSWORD"];
    return POP3MessageFetch($config['MAIL_SERVER'], $config['MAIL_SERVER_PORT'], $email, $password, $config['INPUT_PROTOCOL'], $config['TIME_OFFSET'], $config['TEST_EMAIL']);
}
Example #4
0
function TestPOP3MessageFetch()
{
    print "**************RUNING IN TESTING MODE************\n";
    $config = GetConfig();
    $config["MAIL_USERID"] = $config["TEST_EMAIL_ACCOUNT"];
    $config["MAIL_PASSWORD"] = $config["TEST_EMAIL_PASSWORD"];
    return POP3MessageFetch($config);
}