IMAP connection server code.
<?php
Connect an IMAP server link with an IMAP port of 143.
$mbox = Imap_open ("{Localhost:143}inbox", "user_id", "password");
Connection POP3 Server link, POP3 port is 110.
$mbox = Imap_open ("{Localhost/pop3:110}inbox", "user_id", "password");
Connect to the NNTP Server link, NNTP has a port of 119.
$NNTP = Imap_open ("{localhost/nntp:119}comp.test", "" "," ");
?>
A bit more complex IMAP connection method.
<?php
Connecting to an IMAP server
$mbox = Imap_open ("{imap.example.org}", "username", "password", Op_halfopen)
Or Die ("Connection failed:".) Imap_last_error ());
$list = Imap_getmailboxes ($mbox, "{imap.example.org}", "*");
if (Is_array ($list)) {
foreach ($list as $key => $val) {
echo "($key)";
Echo Imap_utf7_decode ($val->name). ",";
echo "'". $val->delimiter. "',";
Echo $val->attributes. "<br/>n";
}
} else {
echo "Imap_getmailboxes failed:". Imap_last_error (). "N";
}
Turn off IMAP connections
Imap_close ($mbox);
?>
Please specify www.111cn.net/phper/php.html