FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Check email
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Check email [message #176752] Sun, 22 January 2012 03:16 Go to next message
sl@exabyte is currently offline  sl@exabyte
Messages: 16
Registered: March 2011
Karma: 0
Junior Member
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.
Re: Check email [message #176754 is a reply to message #176752] Sun, 22 January 2012 04:15 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 1/21/2012 10:16 PM, sl@exabyte wrote:
> 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.
>
>

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.
jstucklex(at)attglobal(dot)net
==================
Re: Check email [message #176757 is a reply to message #176752] Sun, 22 January 2012 07:28 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
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 = "mail(at)example(dot)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
Re: Check email [message #176758 is a reply to message #176754] Sun, 22 January 2012 12:10 Go to previous messageGo to next message
rataplanpupum is currently offline  rataplanpupum
Messages: 2
Registered: December 2011
Karma: 0
Junior Member
> 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!!!
Re: Check email [message #176761 is a reply to message #176757] Sun, 22 January 2012 20:24 Go to previous messageGo to next message
Captain Paralytic is currently offline  Captain Paralytic
Messages: 204
Registered: September 2010
Karma: 0
Senior Member
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!
Re: Check email [message #176764 is a reply to message #176761] Sun, 22 January 2012 21:39 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
Captain Paralytic, 2012-01-22 21:24:

> 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 ?

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.


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
Re: Check email [message #176776 is a reply to message #176752] Mon, 23 January 2012 08:41 Go to previous messageGo to next message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma: 0
Senior Member
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
--
Re: Check email [message #176777 is a reply to message #176752] Mon, 23 January 2012 09:11 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
Am 22.01.2012 04:16, schrieb sl@exabyte:
> 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.
>
>

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.
Re: Check email [message #176932 is a reply to message #176752] Mon, 06 February 2012 23:20 Go to previous messageGo to next message
Redcat is currently offline  Redcat
Messages: 3
Registered: February 2012
Karma: 0
Junior Member
On Sun, 22 Jan 2012 11:16:38 +0800, sl@exabyte wrote:

> 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.

Is the maildir or mailbox in which the mail resides on the server which
is running PHP?

Redcat
Re: Check email [message #176933 is a reply to message #176932] Tue, 07 February 2012 00:43 Go to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 2/6/2012 6:20 PM, Redcat wrote:
> On Sun, 22 Jan 2012 11:16:38 +0800, sl@exabyte wrote:
>
>> 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.
>
> Is the maildir or mailbox in which the mail resides on the server which
> is running PHP?
>
> Redcat

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.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: reduce all spaces to one
Next Topic: Re: Tips to find Technical Co-founder / Tech lead
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 17:50:22 GMT 2024

Total time taken to generate the page: 0.02447 seconds