generate New mail alert for any mail client at client side

Discussion in 'Javascript' started by subhadip, Mar 28, 2007.

  1. subhadip

    subhadip Guest

    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
    subhadip, Mar 28, 2007
    #1
    1. Advertising

  2. subhadip

    RobG Guest

    Re: generate New mail alert for any mail client at client side

    On Mar 28, 5:58 pm, "subhadip" <> wrote:
    > 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).


    --
    Rob
    RobG, Mar 28, 2007
    #2
    1. Advertising

  3. subhadip

    Tester Guest

    On 28 Mar 2007 00:58:31 -0700, "subhadip" <>
    wrote:

    >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);

    --
    Posted via a free Usenet account from http://www.teranews.com
    Tester, Mar 28, 2007
    #3
  4. subhadip

    subhadip Guest

    Re: generate New mail alert for any mail client at client side

    On Mar 28, 7:59 pm, Tester <> wrote:
    > On 28 Mar 2007 00:58:31 -0700, "subhadip" <>
    > wrote:
    >
    >
    >
    > >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);
    >
    > --
    > Posted via a free Usenet account fromhttp://www.teranews.com


    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
    subhadip, Mar 28, 2007
    #4
  5. subhadip

    Randy Howard Guest

    On Wed, 28 Mar 2007 02:58:31 -0500, subhadip wrote
    (in article <>):

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

    --
    Randy Howard (2reply remove FOOBAR)
    "The power of accurate observation is called cynicism by those
    who have not got it." - George Bernard Shaw
    Randy Howard, Mar 28, 2007
    #5
  6. subhadip

    Randy Howard Guest

    On Wed, 28 Mar 2007 12:35:15 -0500, ThePsyko wrote
    (in article <>):

    > On 28 Mar 2007 I stormed the castle called alt.2600 and heard subhadip
    > cry out in news:...
    >
    >> 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
    >>
    >>

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


    --
    Randy Howard (2reply remove FOOBAR)
    "The power of accurate observation is called cynicism by those
    who have not got it." - George Bernard Shaw
    Randy Howard, Mar 28, 2007
    #6
  7. subhadip

    Randy Howard Guest

    On Wed, 28 Mar 2007 15:51:11 -0500, ThePsyko wrote
    (in article <>):

    > On 28 Mar 2007 I stormed the castle called alt.2600 and heard Randy
    > Howard cry out in
    > news:...
    >
    >> On Wed, 28 Mar 2007 12:35:15 -0500, ThePsyko wrote
    >> (in article <>):
    >>
    >>> On 28 Mar 2007 I stormed the castle called alt.2600 and heard
    >>> subhadip cry out in
    >>> news:...
    >>>
    >>>> 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
    >>>>
    >>>>
    >>>
    >>> 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.
    >>
    >>

    >
    > gee, ya think? Thanks for the info!


    So the irony was or was not wasted on you?



    --
    Randy Howard (2reply remove FOOBAR)
    "The power of accurate observation is called cynicism by those
    who have not got it." - George Bernard Shaw
    Randy Howard, Mar 28, 2007
    #7
  8. subhadip

    Jim Langston Guest

    Re: generate New mail alert for any mail client at client side

    "subhadip" <> wrote in message
    news:...
    > On Mar 28, 7:59 pm, Tester <> wrote:
    >> On 28 Mar 2007 00:58:31 -0700, "subhadip" <>
    >> wrote:
    >>
    >>
    >>
    >> >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);
    >>
    >> --
    >> Posted via a free Usenet account fromhttp://www.teranews.com

    >
    > 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.
    Jim Langston, Mar 28, 2007
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    1,006
  2. Replies:
    0
    Views:
    424
  3. Replies:
    0
    Views:
    503
  4. Mersh
    Replies:
    0
    Views:
    487
    Mersh
    Mar 13, 2007
  5. Ganesh
    Replies:
    0
    Views:
    551
    Ganesh
    Jun 29, 2007
Loading...

Share This Page