note 99596 deleted from function.imap-open by cmb
| From: | cmb@php.net | Date: | Sun, 08 Dec 2019 11:25:51 +0000 |
| Subject: | note 99596 deleted from function.imap-open by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-213463@lists.php.net to get a copy of this message | ||
Note Submitter: anthony2009 at ns dot sympatico dot ca
----
<?php
// You can break out the variables for $mailserver, $port, $user and
// $pass without passing brackets into functions this way. Be sure to use
// the dots to append connection strings, ie "stuff". $variable ."STUFF"
// otherwise will go to imap_open with wrong variable type. :)
$mailserver="mail.example.com";
$port="110/pop3";
$user="aj";
$pass="remax01";
if ($mbox=imap_open( "{" . $mailserver . ":" . $port . "}INBOX",
$user, $pass ))
{ echo "Connected\n";
$check = imap_mailboxmsginfo($mbox);
echo "Date: " . $check->Date . "<br />\n" ;
echo "Driver: " . $check->Driver . "<br />\n" ;
echo "Unread: " . $check->Unread . "<br />\n" ;
echo "Size: " . $check->Size . "<br />\n" ;
imap_close($mbox);
} else { exit ("Can't connect: " . imap_last_error() ."\n"); echo
"FAIL!\n"; };
?>