| 1 |
|
<? |
| 2 |
|
echo date("r"); |
| 3 |
|
echo "<hr>"; |
| 4 |
|
|
| 5 |
|
$username="denis"; |
| 6 |
|
$password="temp"; |
| 7 |
|
//$options="/notls"; |
| 8 |
|
//$connect_string="{localhost:143/notls}Drafts"; |
| 9 |
|
$connect_string="{localhost:143/notls}INBOX"; |
| 10 |
|
|
| 11 |
|
echo $username.':'.$password.'@'.$connect_string; |
| 12 |
|
echo "<hr>"; |
| 13 |
|
|
| 14 |
|
$imap = imap_open($connect_string, $username, $password, $options); |
| 15 |
|
|
| 16 |
|
$status = imap_status($imap, $connect_string, SA_ALL); |
| 17 |
|
print_r(imap_errors()); |
| 18 |
|
echo $status; |
| 19 |
|
|
| 20 |
|
$check = imap_check($imap); |
| 21 |
|
dump($check); |
| 22 |
|
|
| 23 |
|
$mailboxes = imap_getmailboxes($imap, $connect_string, "*"); |
| 24 |
|
print_r($mailboxes); |
| 25 |
|
|
| 26 |
|
// Fetch an overview for all messages in INBOX |
| 27 |
|
|
| 28 |
|
$result = imap_fetch_overview($imap,"1:{$check->Nmsgs}"); |
| 29 |
|
dump($result); |
| 30 |
|
|
| 31 |
|
echo "<hr>"; |
| 32 |
|
|
| 33 |
|
$result = imap_fetchheader($imap, 4, FT_UID); |
| 34 |
|
dump($result); |
| 35 |
|
|
| 36 |
|
|
| 37 |
|
imap_close($imap); |
| 38 |
|
|
| 39 |
|
function dump($data) { |
| 40 |
|
echo "<pre>"; |
| 41 |
|
print_r($data); |
| 42 |
|
echo "</pre>"; |
| 43 |
|
} |
| 44 |
|
?> |