File "mg.php"

Full Path: /home/gerstori/public_html/de/mg.php
File size: 900 bytes
MIME-type: text/x-php; charset=us-ascii
Charset: utf-8

<?php

$server = '{mail.runbox.com:993/imap/ssl/novalidate-cert}INBOX';
$username = 'dubi';
$password = 'Qwer1234';

error_reporting(0);
$imap = imap_open($server, $username, $password,OP_READONLY) or die('Err: ' . imap_last_error());
$total_messages = imap_num_msg($imap);
echo '<html><head>
<meta name="viewport" content="width=device-width, initial-scale=0.9">
</head><body>';
if ($total_messages > 0) {

    $last_message_num = $total_messages;
    $header = imap_headerinfo($imap, $last_message_num);
    $subject = mb_decode_mimeheader($header->subject);
    $from = $header->from[0]->mailbox . '@' . $header->from[0]->host;
    $body = imap_body($imap, $last_message_num);
    if(preg_match("/(\d{6})</",$body,$res)) $code=$res[1];
    echo "Title: " . $subject . "<br>";
    echo "Code: " . $code . "<br>";
} else {
    echo "empty mail";
}
imap_close($imap);

?>