Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Check email

5 views
Skip to first unread message

sl@exabyte

unread,
Jan 21, 2012, 10:16:38 PM1/21/12
to
Is it possible to find out whether there are any new emails in a mailbox
without logging in ?

In other words, some PHP codes to return the number of new emails in a an
email account.

Thanks.


Jerry Stuckle

unread,
Jan 21, 2012, 11:15:31 PM1/21/12
to
No.

But then this should be asked in an email newsgroup. It has nothing to
do with PHP (any language could be used).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================

Arno Welzel

unread,
Jan 22, 2012, 2:28:52 AM1/22/12
to
sl@exabyte, 2012-01-22 04:16:

> Is it possible to find out whether there are any new emails in a mailbox
> without logging in ?

No.

> In other words, some PHP codes to return the number of new emails in a an
> email account.

One approach:

<?php
$server = "{pop3.example.com:110/pop3}INBOX";
$user = "ma...@example.com";
$pass = "mypassword";
$messagecount = 0;

$mbox = imap_open($server, $user, $passwd);
if($mbox)
{
$messagecount = imap_num_msg($mbox);
imap_close($mbox);
}
?>

See more at <http://php.net/manual/en/book.imap.php>.


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de

rataplanpupum

unread,
Jan 22, 2012, 7:10:23 AM1/22/12
to

> But then this should be asked in an email newsgroup. It has nothing to
> do with PHP (any language could be used).
>

sei una vera rottura di coglioni!!!

Captain Paralytic

unread,
Jan 22, 2012, 3:24:11 PM1/22/12
to
On Jan 22, 7:28 am, Arno Welzel <use...@arnowelzel.de> wrote:
> sl@exabyte, 2012-01-22 04:16:
>
> > Is it possible to find out whether there are any new emails in a mailbox
> > without logging in ?
>
> No.
>
> > In other words, some PHP codes to return the number of new emails in a an
> > email account.
>
> One approach:
>
> <?php
> $server = "{pop3.example.com:110/pop3}INBOX";
> $user = "m...@example.com";
> $pass = "mypassword";
> $messagecount = 0;
>
> $mbox = imap_open($server, $user, $passwd);
> if($mbox)
> {
>     $messagecount = imap_num_msg($mbox);
>     imap_close($mbox);}
>
> ?>

Err the question was: Is it possible to find out whether there are any
new emails in a mailbox
without logging in ?

Your solution logs in!

Arno Welzel

unread,
Jan 22, 2012, 4:39:50 PM1/22/12
to
Captain Paralytic, 2012-01-22 21:24:
My answer was "no" - please read, what i wrote.

> Your solution logs in!

Of course, since it is usually not possible without logging in. If you
know a better way - feel free to post it here. But i assume, you also
don't know a better solution.

There is never a dumb question, just dumb answers ;-)

Well - one could check the filesystem of the mail server with PHP as
well and read the contents without logging in via IMAP/POP3 - but this
means, you need to have access to the filesystem via PP and you need to
know which software is used on the server etc. - i think this is far
beyond the knowledge of the OP.

"Álvaro G. Vicario"

unread,
Jan 23, 2012, 3:41:52 AM1/23/12
to
El 22/01/2012 4:16, sl@exabyte escribió/wrote:
> Is it possible to find out whether there are any new emails in a mailbox
> without logging in ?

Only in public mailbox systems like "mailinator.com". Mail, in general,
is supposed to be private.


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--

M. Strobel

unread,
Jan 23, 2012, 4:11:14 AM1/23/12
to
Yes it is possible. If the mails are in a user's mailbox on a unix server you can use
the finger utility:

-l Long format. Produces a multi-line format displaying all of the information
available from the -s option as well as the user's home direc-
tory, home phone number, login shell, mail status, and the contents of
the “.plan” and “.project” files from the user's home directory.


Yes, it's a fun idea. But consider mails sent to system account on linux systems
without beeing forwarded.

/Str.

Redcat

unread,
Feb 6, 2012, 6:20:58 PM2/6/12
to
Is the maildir or mailbox in which the mail resides on the server which
is running PHP?

Redcat

Jerry Stuckle

unread,
Feb 6, 2012, 7:43:04 PM2/6/12
to
It depends completely on your hosting company's setup. But you probably
won't be able to access it unless you have root privileges (or
privileges of your host's email user id).

Talk to your hosting company.
0 new messages