generate New mail alert for any mail client at client side

S

subhadip

Hi,
I want to generate New mail alert for any mail client at client
side .
I want to check if any new mail has arrived in my inbox or
not . the mail client be anything . I want to do this for those mails
which don't give any desktop alert when new mail arrievs . i will
login to my e-mail and then activate the javascript . it will
periodically
retrieve the text contents of my inbox and refresh the page , store it
in a
text file .I will do this action periodically and overwrite the text
file .
from an external java program i will check this text file
periodically to see
if any change has happened or not . suppose the text content in the
file
which indicate time of arrival of a mail , changes , that means that
some change has happened in my inbox . which means that new mail has
arrived
and I will generate an alert . I may embed the script in my browser
e.g. opera. Is this possible ?
Can you suggest any code for this ?
Thank you.
Regards
 
R

RobG

Hi,
I want to generate New mail alert for any mail client at client
side .

If your mail client is scriptable with javascript, then you might be
able to (e.g. Apple's Mail client is scriptable with AppleScript, but
that's very different to javascript). You certainly can't do it with
all mail clients.

You can't do it from javascript in a web page unless your browser
provides a scriptable API that talks to another API to your mail
client (which is highly unlikely).
 
T

Tester

Hi,
I want to generate New mail alert for any mail client at client
side .
I want to check if any new mail has arrived in my inbox or
not . the mail client be anything . I want to do this for those mails
which don't give any desktop alert when new mail arrievs . i will
login to my e-mail and then activate the javascript . it will
periodically
retrieve the text contents of my inbox and refresh the page , store it
in a
text file .I will do this action periodically and overwrite the text
file .
from an external java program i will check this text file
periodically to see
if any change has happened or not . suppose the text content in the
file
which indicate time of arrival of a mail , changes , that means that
some change has happened in my inbox . which means that new mail has
arrived
and I will generate an alert . I may embed the script in my browser
e.g. opera. Is this possible ?
Can you suggest any code for this ?


Here's a simple Windows cmd.exe script I use to check mail at a server
using the Cygwin ports of *nix echo and netcat (nc).

@C:\cygwin\bin\echo -e user name\pass password\nlist\nquit\n | nc
pop3servername 110

Of course, you have to specify the path of echo or link the program to
another name because the built-in echo's in cmd.exe or a Unix shell
such as bash don't know what to do with \n.

You could also do something like this in Perl

#!/usr/bin/perl -w
use IO::Socket;
$remote = IO::Socket::INET->new(
Proto => "tcp",
PeerAddr => "nameofpop3server",
PeerPort => "pop3(110)",
)
or die "cannot connect to your pop3";

print $remote "user yourname\n";
$a = <$remote>; print $a ;
print "\n";
print $remote "pass password\n";
$a = <$remote>; print $a ;
print "\n";
yrint $remote "list\n";
$a = <$remote>; print $a;
$a = <$remote>; print $a;
print $remote "quit\n";
$a = <$remote>; print $a;
$a = <$remote>; print $a;
close($remote);
 
S

subhadip

Here's a simple Windows cmd.exe script I use to check mail at a server
using the Cygwin ports of *nix echo and netcat (nc).

@C:\cygwin\bin\echo -e user name\pass password\nlist\nquit\n | nc
pop3servername 110

Of course, you have to specify the path of echo or link the program to
another name because the built-in echo's in cmd.exe or a Unix shell
such as bash don't know what to do with \n.

You could also do something like this in Perl

#!/usr/bin/perl -w
use IO::Socket;
$remote = IO::Socket::INET->new(
Proto => "tcp",
PeerAddr => "nameofpop3server",
PeerPort => "pop3(110)",
)
or die "cannot connect to your pop3";

print $remote "user yourname\n";
$a = <$remote>; print $a ;
print "\n";
print $remote "pass password\n";
$a = <$remote>; print $a ;
print "\n";
yrint $remote "list\n";
$a = <$remote>; print $a;
$a = <$remote>; print $a;
print $remote "quit\n";
$a = <$remote>; print $a;
$a = <$remote>; print $a;
close($remote);

Thank you very much . What if the mail don't support POP? I want to
make the application for those mails which don't support POP or any
alert .
Regards
 
R

Randy Howard

Hi,
I want to generate New mail alert for any mail client at client
side .
I want to check if any new mail has arrived in my inbox or
not . the mail client be anything . I want to do this for those mails
which don't give any desktop alert when new mail arrievs .

I think I used xbiff for this starting about 15 years ago. There are
probably a lot more out there now. Or, just use an OS where the mail
tools are not still stuck in the 1980s.

The usual method (on systems that don't use proprietary, i.e. evil,
mail formats, such as .pst) is to just look at the mbox folder(s) and
check for new arrivals. Something like inotify may be suitable for
your platform, but you didn't indicate what OS you are interested in...
 
R

Randy Howard

On 28 Mar 2007 I stormed the castle called alt.2600 and heard subhadip
cry out in

Seems like a lot of work when simply pressing F5 would do the same
thing...

The F5 key (whatever it does on your system) probably didn't start
working by pure magic.
 
R

Randy Howard

On 28 Mar 2007 I stormed the castle called alt.2600 and heard Randy
Howard cry out in


gee, ya think? Thanks for the info!

So the irony was or was not wasted on you?
 
J

Jim Langston

subhadip said:
Thank you very much . What if the mail don't support POP? I want to
make the application for those mails which don't support POP or any
alert .

Then look up the protocol for what your mail server does use and code for
that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top