|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
this code supposed to wrtie how many mails i have in my mailbox in
gmail: <?php $ServerName = "{pop.gmail.com:995/pop3/ssl/novalidate-cert}"; $UserName = "user"; $PassWord = "pass"; $mbox = imap_open($ServerName, $UserName,$PassWord) or die("Could not open Mailbox - try again later!"); if ($hdr = imap_check($mbox)) { echo "Num Messages " . $hdr->Nmsgs; } else { echo "failed"; ?> when i used this code at the first time,it wrote exacly how many mail i have,but every time when i used it again its wrote one mail less. what the problem?? |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
hareldo escribió:
> <?php > $ServerName = "{pop.gmail.com:995/pop3/ssl/novalidate-cert}"; > > $UserName = "user"; > $PassWord = "pass"; > > $mbox = imap_open($ServerName, $UserName,$PassWord) or die("Could > not open Mailbox - try again later!"); > > if ($hdr = imap_check($mbox)) { > echo "Num Messages " . $hdr->Nmsgs; > } else { > echo "failed"; > ?> > > when i used this code at the first time,it wrote exacly how many mail > i have,but every time when i used it again its wrote one mail less. > what the problem?? Comments in the PHP manual page for imap_check() say: "Running this on a mailbox will mark recent/new messages as checked." "You can prevent imap_check from flagging new/recent messages as checked by calling imap_open with the "/readonly" or OP_READONLY flags." -- -- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain -- Mi sitio sobre programación web: http://bits.demogracia.com -- Mi web de humor al baño María: http://www.demogracia.com -- |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
thank.
the problem was not in the code.there was a problem with the definitions ofthe mailbox. now its work. |
|
![]() |
| Outils de la discussion | |
|
|