How to know about the arrival of email using gmail smtp
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I used the IMAP module from CPAN, and was able to do EXACTLY what you're after in 34 lines of code, and it took me less than ten minutes.
Actually again, i would say that its not a coding problem. I cant try any coding. Its a downloading problem. That's i say that you people do not understand my problem. How can i write the code for AnyEvent::GMail::Feed if i cant download this module.
As far as coming back is concerned, I decided to come back because other people were also not able to help me in downloading. So its not your fault. Why i should be giving any punishment to you people there is no fault of yours. Also i am still getting Linux emails. So i thought that you people dont like me to go away. That's why i have come back.
I have not declared this as 'solved' problem. If you feel that it can be solved by IMAP, i would try this. But i would be working at snail's speed because now i have to teach another course.
So it may take one more year. Do not tell me that i am not able to solve it for two years. I am not a software developer like you people. I just teach courses and these keep changing.
Actually again, i would say that its not a coding problem. I cant try any coding. Its a downloading problem. That's i say that you people do not understand my problem. How can i write the code for AnyEvent::GMail::Feed if i cant download this module.
really!!! Sir what about you asking this:
Quote:
I got an email program from a web site. I tried this its running. Can some body guide me how to know about the arrival of email using gmail smtp?
I dont see any downloading problem mentioned here but only cut paste.
Quote:
So its not your fault. Why i should be giving any punishment to you people there is no fault of yours.
This never was our fault, trying to help you was indeed.
Quote:
Also i am still getting Linux emails.
Since you are subscribed for it.
Quote:
I have not declared this as 'solved' problem.
Nor did we, but trying to get Moderators marked this as closed.
Quote:
If you feel that it can be solved by IMAP, i would try this. But i would be working at snail's speed because now i have to teach another course.
Hi,
Actually again, i would say that its not a coding problem. I cant try any coding.
And WHY (as a "teacher") can you not 'try any coding'?? It IS a coding problem...because YOU can't write code.
Quote:
Its a downloading problem.
Nope, sorry...you've downloaded many things, and copy/pasted code over and over. You just aren't able to understand what you need to do to make what you're stealing work.
Quote:
That's i say that you people do not understand my problem.
We understand your problem very well...we have given you MANY solutions. YOU don't understand the answers...that is VERY clear. The REAL problem is your lack of effort, and your blatant lies.
Quote:
How can i write the code for AnyEvent::GMail::Feed if i cant download this module.
You can EASILY download it...there are MANY download options for it, for several versions, either through CPAN or through source installation. Source installation ALWAYS works, since you can manually resolve any errors that CPAN may not be able to, since you have a bad installation (which you don't understand how to fix).
AGAIN, it seems odd as a 'teacher', that you don't have permissions to add things to your own workstation, or your classroom environment. Seems even odder that you post on a Linux forum when you are using a Windows system.
Quote:
As far as coming back is concerned, I decided to come back because other people were also not able to help me in downloading.
And we'd very much appreciate it if you went somewhere else, until you're able to understand what people are telling you, are not rude, and stop lying to people.
Quote:
So its not your fault. Why i should be giving any punishment to you people there is no fault of yours.
Exactly...your problems are ENTIRELY YOUR FAULT.
Quote:
Also i am still getting Linux emails. So i thought that you people dont like me to go away. That's why i have come back.
Again, this speaks to your lack of understanding....if you don't want emails, then WHY DID YOU SIGN UP FOR THEM??? NO ONE asked you to come back.
Quote:
I have not declared this as 'solved' problem. If you feel that it can be solved by IMAP, i would try this. But i would be working at snail's speed because now i have to teach another course.
No, you don't...you're still not a teacher, and no one here believes you are.
Quote:
So it may take one more year. Do not tell me that i am not able to solve it for two years.
You've been working on it for a year now...if you're not able to do it until next year, that means that it took you TWO YEARS. Since you're a 'teacher', do you not understand 1+1=2? And again, it took me 10 minutes and less than 40 lines of code (with comments), to do this. You have been 'working' on this for a YEAR...are we supposed to believe that you haven't been able to manage this in all that time? That you can't manage to spend even a full HOUR in more than a year to write your own code?
Quote:
I am not a software developer like you people. I just teach courses and these keep changing.
No, you don't...you're not a teacher. And if you're not teaching programming or computer-related courses, then WHY do you need to do this as part of your 'teaching'?????
Hi,
My old friends. You know Old is Gold. Yes you can stop this thread. You can use your contacts for that. But it would be your second defeat. I am not interested in that so i wont opt this option. Because in my view its a universal problem.
Code:
[root@localhost lab6]# yum install perl-Mail-IMAPClient
Loaded plugins: langpacks, refresh-packagekit
Existing lock /var/run/yum.pid: another copy is running as pid 2339.
Another app is currently holding the yum lock; waiting for it to exit...
updates/20/x86_64/primary_db | 12 MB 01:04
Resolving Dependencies
--> Running transaction check
---> Package perl-Mail-IMAPClient.noarch 0:3.35-1.fc20 will be installed
--> Processing Dependency: perl(Parse::RecDescent) for package: perl-Mail-IMAPClient-3.35-1.fc20.noarch
--> Running transaction check
---> Package perl-Parse-RecDescent.noarch 0:1.967009-7.fc20 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
perl-Mail-IMAPClient noarch 3.35-1.fc20 updates 217 k
Installing for dependencies:
perl-Parse-RecDescent noarch 1.967009-7.fc20 fedora 203 k
Transaction Summary
================================================================================
Install 1 Package (+1 Dependent package)
Total download size: 419 k
Installed size: 1.8 M
Is this ok [y/d/N]: y
Downloading packages:
(1/2): perl-Parse-RecDescent-1.967009-7.fc20.noarch.rpm | 203 kB 00:08
perl-Mail-IMAPClient-3.35-1.fc FAILED
http://mirrors.hustunique.com/fedora/updates/20/x86_64/perl-Mail-IMAPClient-3.35-1.fc20.noarch.rpm: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
(2/2): perl-Mail-IMAPClient-3.35-1.fc20.noarch.rpm | 217 kB 00:07
--------------------------------------------------------------------------------
Total 22 kB/s | 419 kB 00:19
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : perl-Parse-RecDescent-1.967009-7.fc20.noarch 1/2
Installing : perl-Mail-IMAPClient-3.35-1.fc20.noarch 2/2
Verifying : perl-Mail-IMAPClient-3.35-1.fc20.noarch 1/2
Verifying : perl-Parse-RecDescent-1.967009-7.fc20.noarch 2/2
Installed:
perl-Mail-IMAPClient.noarch 0:3.35-1.fc20
Dependency Installed:
perl-Parse-RecDescent.noarch 0:1.967009-7.fc20
Complete!
[root@localhost lab6]#
Then i tried to install the Net::IMAP::Simple through yum but it didnt work.
Code:
[root@localhost lab6]# yum install perl-Net-IMAP-Client
Loaded plugins: langpacks, refresh-packagekit
No package perl-Net-IMAP-Client available.
Error: Nothing to do
Then i used CPAN & ithink its installed:
Code:
[root@localhost lab6]# cpan
Terminal does not support AddHistory.
cpan shell -- CPAN exploration and modules installation (v2.00)
Enter 'h' for help.
cpan[1]> install Net::IMAP::Simple
Reading '/root/.cpan/Metadata'
Database was generated on Mon, 24 Nov 2014 09:29:02 GMT
Fetching with LWP:
http://cpan.mirror.choon.net/authors/01mailrc.txt.gz
Reading '/root/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Fetching with LWP:
http://cpan.mirror.choon.net/modules/02packages.details.txt.gz
Reading '/root/.cpan/sources/modules/02packages.details.txt.gz'
Database was generated on Mon, 08 Dec 2014 03:53:16 GMT
..............
New CPAN.pm version (v2.05) available.
[Currently running version is v2.00]
You might want to try
install CPAN
reload cpan
to both upgrade CPAN.pm and run the new version without leaving
the current session.
..............................................................DONE
Fetching with LWP:
http://cpan.mirror.choon.net/modules/03modlist.data.gz
Reading '/root/.cpan/sources/modules/03modlist.data.gz'
DONE
Writing /root/.cpan/Metadata
Running install for module 'Net::IMAP::Simple'
Running make for J/JE/JETTERO/Net-IMAP-Simple-1.2205.tar.gz
Fetching with LWP:
http://cpan.mirror.choon.net/authors/id/J/JE/JETTERO/Net-IMAP-Simple-1.2205.tar.gz
Fetching with LWP:
http://cpan.mirror.choon.net/authors/id/J/JE/JETTERO/CHECKSUMS
Checksum for /root/.cpan/sources/authors/id/J/JE/JETTERO/Net-IMAP-Simple-1.2205.tar.gz ok
Scanning cache /root/.cpan/build for sizes
............................................................................DONE
CPAN.pm: Building J/JE/JETTERO/Net-IMAP-Simple-1.2205.tar.gz
Do you wish to include some simple protocol extensions (pulls in Parse::RecDescent)? [y] y
Checking if your kit is complete...
Looks good
Writing Makefile for Net::IMAP::Simple
Could not read metadata file. Falling back to other methods to determine prerequisites
cp SimpleX.pm blib/lib/Net/IMAP/SimpleX.pm
cp lib/Net/IMAP/Simple/PipeSocket.pm blib/lib/Net/IMAP/Simple/PipeSocket.pm
cp SimpleX.pod blib/lib/Net/IMAP/SimpleX.pod
cp Simple.pm blib/lib/Net/IMAP/Simple.pm
cp Simple.pod blib/lib/Net/IMAP/Simple.pod
Manifying blib/man3/Net::IMAP::Simple.3pm
Manifying blib/man3/Net::IMAP::Simple::PipeSocket.3pm
Manifying blib/man3/Net::IMAP::SimpleX.3pm
JETTERO/Net-IMAP-Simple-1.2205.tar.gz
/usr/bin/make -- OK
'YAML' not installed, will not store persistent state
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/01_load.t .......................... ok
t/07_select_and_examine.t ............ ok y tests -- see t/test_runner.pm]
t/08_selectalot.t .................... ok any tests -- see t/test_runner.pm]
t/10_list.t .......................... ok
t/11_mailboxes.t ..................... ok any tests -- see t/test_runner.pm]
t/15_flags.t ......................... ok y tests -- see t/test_runner.pm]
t/16_exotic_flags.t .................. ok any tests -- see t/test_runner.pm]
t/17_status_and_select.t ............. ok any tests -- see t/test_runner.pm]
t/19_readline_callback.t ............. ok any tests -- see t/test_runner.pm]
t/22_copy_multiple.t ................. ok any tests -- see t/test_runner.pm]
t/22_uidcopy_multiple.t .............. ok any tests -- see t/test_runner.pm]
t/23_delete_multiple.t ............... ok any tests -- see t/test_runner.pm]
t/35_imap_results_in_message_body.t .. ok any tests -- see t/test_runner.pm]
t/42_preauth_with_command.t .......... ok
t/45_search.t ........................ ok any tests -- see t/test_runner.pm]
t/50_body_summary.t .................. ok y tests -- see t/test_runner.pm]
t/55_uid_stuff.t ..................... ok any tests -- see t/test_runner.pm]
t/60_fetch_with_grammar.t ............ ok any tests -- see t/test_runner.pm]
t/70_list2range.t .................... ok
t/75_back_and_forth.t ................ ok y tests -- see t/test_runner.pm]
t/80_top.t ........................... ok
t/critic.t ........................... ok
t/pod.t .............................. ok
t/pod_coverage.t ..................... ok
All tests successful.
Files=24, Tests=148, 1 wallclock secs ( 0.06 usr 0.01 sys + 0.59 cusr 0.07 csys = 0.73 CPU)
Result: PASS
JETTERO/Net-IMAP-Simple-1.2205.tar.gz
/usr/bin/make test -- OK
Running make install
Manifying blib/man3/Net::IMAP::Simple.3pm
Manifying blib/man3/Net::IMAP::Simple::PipeSocket.3pm
Manifying blib/man3/Net::IMAP::SimpleX.3pm
Installing /root/perl5/lib/perl5/Net/IMAP/Simple.pod
Installing /root/perl5/lib/perl5/Net/IMAP/Simple.pm
Installing /root/perl5/lib/perl5/Net/IMAP/SimpleX.pod
Installing /root/perl5/lib/perl5/Net/IMAP/SimpleX.pm
Installing /root/perl5/lib/perl5/Net/IMAP/Simple/PipeSocket.pm
Installing /root/perl5/man/man3/Net::IMAP::Simple::PipeSocket.3pm
Installing /root/perl5/man/man3/Net::IMAP::SimpleX.3pm
Installing /root/perl5/man/man3/Net::IMAP::Simple.3pm
Appending installation info to /root/perl5/lib/perl5/x86_64-linux-thread-multi/perllocal.pod
JETTERO/Net-IMAP-Simple-1.2205.tar.gz
/usr/bin/make install -- OK
cpan[2]>
If its installed then i can try writing code. You know iam not a developer. Even a developer cant write a pogram without a perl module or simply "Can you drive a car with out petrol/gasoline"?
If its installed then i would try writing the code.
Hi,
My old friends. You know Old is Gold. Yes you can stop this thread. You can use your contacts for that. But it would be your second defeat. I am not interested in that so i wont opt this option. Because in my view its a universal problem.
No, sorry, it STILL isn't a 'universal problem'...it's YOUR PROBLEM, because you just cannot understand what you're getting told, period. If numerous others can easily install those modules, and write code that uses them, but YOU cannot, that doesn't mean that there is a 'universal problem'...that means it's YOUR problem. No one is 'defeated' here, except YOU. You keep begging for handouts, and no matter how simple we explain things, you just don't understand. Again, this was a ten-minute, less-than-40-line program for me to write....you're a 'teacher' (which we DO NOT BELIEVE), yet can't spend a single hour OVER THE PAST YEAR, to figure out how to make any of the easily-found samples (many of which you were spoon-fed, because you apparently can't perform a Google search either), work.
That's like saying "My car won't start, so everyone's cars must be broken today".
Quote:
Code:
[root@localhost lab6]# yum install perl-Mail-IMAPClient
Loaded plugins: langpacks, refresh-packagekit
Existing lock /var/run/yum.pid: another copy is running as pid 2339.
Another app is currently holding the yum lock; waiting for it to exit...
...and this is a great example of how far in over your head you are. Running multiple copies of yum at the same time????
Quote:
Then i tried to install the Net::IMAP::Simple through yum but it didnt work.
Code:
[root@localhost lab6]# yum install perl-Net-IMAP-Client
Loaded plugins: langpacks, refresh-packagekit
No package perl-Net-IMAP-Client available.
Error: Nothing to do
Right...because, AGAIN, that is not in the yum repositories...you have to install it from CPAN, as you've been told SEVERAL TIMES NOW, but you seem to be unable to understand this.
Quote:
Then i used CPAN & ithink its installed:
Code:
[root@localhost lab6]# cpan
Terminal does not support AddHistory.
cpan shell -- CPAN exploration and modules installation (v2.00)
Enter 'h' for help.
cpan[1]> install Net::IMAP::Simple
Appending installation info to /root/perl5/lib/perl5/x86_64-linux-thread-multi/perllocal.pod
JETTERO/Net-IMAP-Simple-1.2205.tar.gz
/usr/bin/make install -- OK
You THINK it's installed???? Again, can you not read or understand the words you posted? Can you not just query your system to VERIFY it was installed????
[QUOTE}If its installed then i can try writing code.
So what's stopping you? Go write it...we've been asking you to show your work for a LONG time now.
Quote:
You know iam not a developer. Even a developer cant write a pogram without a perl module
They certainly can...by DEVELOPING the module and writing the code they need. I do it frequently.
Quote:
or simply "Can you drive a car with out petrol/gasoline"?
Sure can...if you have knowledge, which is earned by doing and researching, rather than begging for handouts. Diesel engines run just fine on vegetable oil, with some changes. Can run engines on hydrogen too, or some alcohol blends.
Quote:
If its installed then i would try writing the code.
Hi,
I got a program from perl monk site. Its allowing me to access all my gmail folders. Its working on my Linux machine (& hope would run on other Linux machines) but not on all my windows PC's.
Code:
[root@localhost Zulfi]# perl imap.pl
I'm authenticated
Folders:
* INBOX
* Personal
* Receipts
* Travel
* Work
* [Gmail]
* [Gmail]/All Mail
* [Gmail]/Drafts
* [Gmail]/Important
* [Gmail]/Sent Mail
* [Gmail]/Spam
* [Gmail]/Starred
* [Gmail]/Trash
[root@localhost Zulfi]# cat imap.pl
#!/usr/bin/perl
use strict;
use warnings;
use Mail::IMAPClient;
use IO::Socket::SSL;
# Connect to the IMAP server via SSL
my $socket = IO::Socket::SSL->new( PeerAddr => 'imap.gmail.com',
PeerPort => 993, ) or die "socket(): $@";
# Build up a client attached to the SSL socket.
# Login is automatic as usual when we provide User and Password
my $client = Mail::IMAPClient->new( Socket => $socket, User => 'id@gmail.com',
Password => 'passwdgmail', ) or die "new(): $@";
# Do something just to see that it's all ok
print "I'm authenticated\n" if $client->IsAuthenticated();
my @folders = $client->folders();
print join("\n* ", 'Folders:', @folders), "\n";
# Say bye
$client->logout();
[root@localhost Zulfi]#
I dont know how to access the contents of inbox folder but i would try.
So, AGAIN, you copied-and-pasted someone elses code, did NOTHING with it, and after more than a year of "work", you can't modify it slightly? I thought you were having a 'universal' and unsolvable problem that no one understood????
Quote:
Its allowing me to access all my gmail folders. Its working on my Linux machine (& hope would run on other Linux machines) but not on all my windows PC's.
Hi,
Thanks for your interest.
First i tried with the following code:
Code:
[root@localhost Zulfi]# perl imap01.pl
I'm authenticated
Folders:
* INBOX
* Personal
* Receipts
* Travel
* Work
* [Gmail]
* [Gmail]/All Mail
* [Gmail]/Drafts
* [Gmail]/Important
* [Gmail]/Sent Mail
* [Gmail]/Spam
* [Gmail]/Starred
* [Gmail]/Trash
There are 115 messages waiting.
MIME-Version: 1.0
Received: by 10.64.94.197; Sun, 8 Apr 2012 07:30:55 -0700 (PDT)
Date: Sun, 8 Apr 2012 07:30:55 -0700
Message-ID: <CANuMjJiv0286xUh-tE3ZT9o8BjgQxZ_SrqqA8OQqN37hp6tCUA@mail.gmail.com>
Subject: Get started with Gmail
From: Gmail Team <mail-noreply@google.com>
To: Zulfi Khan <zulfi60001@gmail.com>
Content-Type: multipart/alternative; boundary=047d7b2edc6dc86fd904bd2bbcae
--047d7b2edc6dc86fd904bd2bbcae
Content-Type: text/plain; charset=ISO-8859-1
4 things you need to know
Gmail is a little bit different. Learn these 4 basics and you'll never look
back.
[image: Inbox screenshot]
1. Archive instead of delete
Tidy up your inbox without deleting anything. You can always search to find
what you need or look in "All Mail."
2. Chat and video chat
Chat directly within Gmail. You can even talk face-to-face with built-in
video chat.
3. Labels instead of folders
Labels do the work of folders with an extra bonus: you can add more than
one to an email.
[image: Conversation screenshot]
4. Conversation view
Gmail groups emails and their replies in your inbox, so you always see your
messages in the context of your conversation. Related messages are stacked
neatly on top of each other, like a deck of cards.
Welcome!
- The Gmail Team
--047d7b2edc6dc86fd904bd2bbcae
Content-Type: text/html; charset=ISO-8859-1
<html>
<font face="Arial, Helvetica, sans-serif">
<p>
<span style="font-size: 120%; font-weight: bold">4 things you need to know</span>
<br />
Gmail is a little bit different. Learn these 4 basics and you'll never
look back.</p>
<img width="297" height="225" src="http://mail.google.com/mail/images/welcome-inbox-screenshot.png" alt="Inbox screenshot" style="float: left; margin-right: 2em" />
<p>
<span style="font-size: 120%; font-weight: bold; white-space: nowrap">1. Archive instead of delete</span>
<br />
Tidy up your inbox without deleting anything. You can always search to find
what you need or look in "All Mail."</p>
<p>
<span style="font-size: 120%; font-weight: bold; white-space: nowrap">2. Chat and video chat</span>
<br />
Chat directly within Gmail. You can even talk face-to-face with built-in video
chat.</p>
<p>
<span style="font-size: 120%; font-weight: bold; white-space: nowrap">3. Labels instead of folders</span>
<br />
Labels do the work of folders with an extra bonus: you can add more than one to
an email.</p>
<p style="clear: left"> </p>
<img width="293" height="111" src="http://mail.google.com/mail/images/welcome-conversation-screenshot.png" alt="Conversation screenshot" style="float: left; margin-right: 2em" />
<p>
<span style="font-size: 120%; font-weight: bold; white-space: nowrap">4. Conversation view</span>
<br />
Gmail groups emails and their replies in your inbox, so you always see your
messages in the context of your conversation. Related messages are stacked
neatly on top of each other, like a deck of cards.</p>
<div style="clear: left"></div>
<p>Welcome!</p>
<p>- The Gmail Team</p>
</font>
</html>
[root@localhost Zulfi]# cat imap01.pl
#!C:/Perl64/bin/perl.exe
use strict;
use warnings;
use Mail::IMAPClient;
use IO::Socket::SSL;
my $msg_subject;
# Connect to the IMAP server via SSL
my $socket = IO::Socket::SSL->new(
PeerAddr => 'imap.gmail.com',
PeerPort => 993,
SSL_verify_mode => SSL_VERIFY_NONE
)
or die "socket(): $@";
# Build up a client attached to the SSL socket.
# Login is automatic as usual when we provide User and Password
my $client = Mail::IMAPClient->new(
Socket => $socket,
User => 'user@gmail.com',
Password => 'passwd',
)
or die "new(): $@";
# Do something just to see that it's all ok
print "I'm authenticated\n" if $client->IsAuthenticated();
my @folders = $client->folders();
print join("\n* ", 'Folders:', @folders), "\n";
$client->select("INBOX");
my @messages = $client->messages();
print "There are " . scalar @messages . " messages waiting.\n";
$client->Ignoresizeerrors(1);
#$client->select("INBOX") or die "Could not select: $@\n";
my $string = $client->message_string(1) or die "could not message: $@\n";
print $string;
# Say bye
$client->logout();
[root@localhost Zulfi]#
Its printing the first message which i got at the start of my account. I want to print the first unread message.
I found a code at stackoverflow but its usinig MIME::Parser & Encode::decode which I cant install on my system.
Also i dont have 115 messages in my INBOX. It has only 75 messages.
Hi,
Thanks for your interest. First i tried with the following code:
No, we really don't have an interest, sorry. We have all tried to help you MANY times, and you've been plain rude, and have continued to lie to us. You made one small change to the code, and that wasn't done correctly, so either you didn't read the instructions or are STILL expecting someone here to fix things for you.
Quote:
Its printing the first message which i got at the start of my account. I want to print the first unread message.
...which is NOT what you asked for, or have BEEN asking for. You have asked to be notified when there is new mail...NOT to display the first unread message.
Quote:
I found a code at stackoverflow but its usinig MIME::Parser & Encode::decode which I cant install on my system.
..and we're back to "why can't you install it???" You're a 'teacher' right??? Why can't you install a module? Or is this yet another 'universal problem' that can't be solved...because you can't follow/understand the instructions?
Quote:
Also i dont have 115 messages in my INBOX. It has only 75 messages.
And that is because you have not selected a folder, so it's returning ALL the unread messages.
What is preventing you from reading or understanding the instructions you have been handed, over and over???? The functions for the IMAP module are VERY clear, and you were spoon-fed the three you need to use. You stole someone elses code, and even with all that you can't manage to make two small changes to a VERY simple program?? After more than a YEAR of effort????
Hi,
If you have no interest then why you helped me MANY times? This is contradictory. I dont know what help i got. Only you guide me to use IMAP, that too after the start of round 2. I was told that i would get help if i show some effort. This is my code:
Code:
$client->Ignoresizeerrors(1);
#$client->select("INBOX") or die "Could not select: $@\n";
my $string = $client->message_string(1) or die "could not message: $@\n";
print $string;
It is printing something though its printing in the reverse direction.
I have now understood what's the problem with it. I would try this maybe tomorrow or on Monday.
Okay notification is my objective, but eventually i have to read the latest arrived email without connecting with gmail using browser.
I have some idea about notification. I would show you my effort and by your rule, i am entitled to get help on this. I dont have Linux system with me right now so its just the logic not the actual program. Yes its a universal problem. I have not seen any code for notification. If you have seen provide me the link. It should not be similar to AnyEvent::Gmail::Feed which does not install.
prev= get mesgcount of emails;
while (1)
{
new_count= get mesgcount of emails;
if(new_count> prev){
generate_an_audio_mesg;
break;
}
}
display_the_new_mesg;
Is the above logic workable?? If not guide me the correct logic.
Have you seen a teacher doing installation?? Its the task of system administrator. Any way I am showing some effort. And again by your rule:"I would get help only if i show some effort"
I have shown you the command for installation. Its not working tell me the correct command.
And what's wrong with this code:
Code:
$client->select("INBOX");
If its wrong tell me the correct code. This is again according to your rule.
I hope you would honor your rule.
Hi,
If you have no interest then why you helped me MANY times? This is contradictory. I dont know what help i got.
Then you haven't been paying attention, or (again) have not understood what you were told.
Quote:
Only you guide me to use IMAP, that too after the start of round 2.
...which you said you couldn't install, because it was a 'universal' problem, that NO ONE could solve.
Quote:
I was told that i would get help if i show some effort. This is my code:
Code:
$client->Ignoresizeerrors(1);
#$client->select("INBOX") or die "Could not select: $@\n";
my $string = $client->message_string(1) or die "could not message: $@\n";
print $string;
If that's all you've managed to produce after an entire YEAR of effort, then it doesn't seem likely that you will EVER be able to write any code of your own. Again, how are you expecting people to believe you're a 'teacher', when you VERY CLEARLY don't know the subject you're teaching?
You post one VERY small snippet of code, one line of which is commented out, and another of which has GLARING errors in its usage. Again, YOU NEED TO READ the IMAP module documentation. It TELLS YOU the syntax of how to use the functions, WITH EXAMPLES.
Quote:
It is printing something though its printing in the reverse direction.
...and since you don't tell us WHAT it's doing, how do you expect anyone to help you????
Quote:
I have now understood what's the problem with it. I would try this maybe tomorrow or on Monday.
And back to "if you know the answer, then WHY POST THE QUESTION???"
Quote:
Okay notification is my objective, but eventually i have to read the latest arrived email without connecting with gmail using browser.
I have some idea about notification. I would show you my effort and by your rule, i am entitled to get help on this. I dont have Linux system with me right now so its just the logic not the actual program.
And you were GIVEN the 'logic', but have NOT APPLIED IT. Again, you were spoon-fed the answers previously, about the status, unseen_count, and message_count options in the IMAP module. Those will do what you want for notification. It is now UP TO YOU to actually do it.
Quote:
Yes its a universal problem. I have not seen any code for notification.
You are again lying. Not only have you, yourself, POSTED code to do notification, there are THOUSANDS of examples you can find with a Google search. This is not a 'universal problem'....the only problem here, is that you are lazy.
Quote:
If you have seen provide me the link.
So you not only want people to write your programs for you, modify them for you, but also do Google searches for you???? At what point, exactly, are YOU actually going to do something???
Quote:
It should not be similar to AnyEvent::Gmail::Feed which does not install.
...because YOU cannot install it, because YOU are not following the instructions.
Quote:
prev= get mesgcount of emails;
while (1)
{
new_count= get mesgcount of emails;
if(new_count> prev){
generate_an_audio_mesg;
break;
}
}
display_the_new_mesg;
Is the above logic workable?? If not guide me the correct logic.
Who knows? You don't say where you got that code, but there isn't anything in there that is recognizable as part of the IMAP library. Where are the generate_an_audio_mesg and display_the_new_mesg things coming in???
Quote:
Have you seen a teacher doing installation?? Its the task of system administrator.
Seen MANY teachers installing what they need. And again, since you claim to be a 'teacher', it should be trivial for you to get your administrator to install anything you need to 'teach' with. That's done all the time too.
Quote:
Any way I am showing some effort. And again by your rule:"I would get help only if i show some effort" I have shown you the command for installation. Its not working tell me the correct command.
No, you're still copying and pasting code from others, and asking us to fix it. That is NOT showing effort.
Quote:
And what's wrong with this code:
Code:
$client->select("INBOX");
If its wrong tell me the correct code. This is again according to your rule. I hope you would honor your rule.
You have STILL not shown any effort of your own...if you think you have, you're wrong. If you want to know what the correct syntax is, then GO READ THE IMAP MODULE INSTRUCTIONS, that TELL YOU what it is. You've been spoon-fed THAT before too, but can't understand the answer.
You are rude, and you're a liar. THAT is why no one is interested in helping you. Many people here have tried, and you just aren't understanding this.
Hi,
I have changed the code. Now i am getting correct value for the unread messages. But its not generating a beep on arrival of new message: My code is:
Code:
my $msgcount = $client->message_count("INBOX");
print "Total messages in INBOX are $msgcount\n" ;
my $unseen = $client->unseen_count("INBOX");
print "Unread messages are $unseen";
my $prev = $unseen;
while (1) {
$unseen = $client->unseen_count ("INBOX");
if($unseen > $prev) {
for ($i=0; $i<10; ++$i) {
print "\a";}}
$prev = $unseen;
}
Kindly guide me. I am not getting any beep on arrival of new message.
So after more than a year of begging, you managed to make a small change to code that you copied from someone else. Congratulations...guess you solved the 'universal' problems, then....
There isn't a part of the IMAP module to beep. However, there ARE other perl modules that WILL enable that feature. So we will 'guide you' to go look it up...you've been spoon-fed enough. Try putting "perl system beep" into Google.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.