PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > mail...
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
mail...

Réponse
 
LinkBack Outils de la discussion
Vieux 22/06/2008, 20h45   #1
hareldo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut mail...

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??
  Réponse avec citation
Vieux 23/06/2008, 16h35   #2
Álvaro G. Vicario
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: mail...

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
--
  Réponse avec citation
Vieux 23/06/2008, 21h20   #3
hareldo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: mail...

thank.
the problem was not in the code.there was a problem with the
definitions ofthe mailbox.
now its work.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 19h20.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08570 seconds with 11 queries