Problem fetching the mails

I am writing a simple program to fetch the mails from the mail server using the following code :
public static void main (String args[]) throws Exception {
String username = args[0];
String password = args[1];
Properties props = new Properties();
Session session = Session.getDefaultInstance(props, null);
Store store = session.getStore("pop3");
store.connect("pop.mail.yahoo.com", username, password);
Folder folder = store.getFolder("INBOX");
folder.open(Folder.READ_ONLY);
BufferedReader reader = new BufferedReader (
new InputStreamReader(System.in));
Message message[] = folder.getMessages();
for (int i=0, n=message.length; i<n; i++) {
System.out.println(i + ": " + message.getFrom()[0]
+ "\t" + message[i].getSubject());
System.out.println("Do you want to read message? [YES to read/QUIT to end]");
String line = reader.readLine();
if ("YES".equals(line)) {
System.out.println(message[i].getContent());
} else if ("QUIT".equals(line)) {
break;
folder.close(false);
store.close();
In this code at the line :
Store store = session.getStore("pop3");
it throws an exception while executing the program : javax.mail.NoSuchProviderException : pop3
i have placed the pop3mail.jar, mail.jar & activation.jar in my classpath still this is the problem.
is there any other provider that is needed ? and if yes from where to get that and where to specify that ?
reply highly appreciable .
thanx

Try changing the store/connection portion of your code from:
Store store = session.getStore("pop3");
store.connect("pop.mail.yahoo.com", username, password);
tp:
Store store = session.getStore("pop.mail.yahoo.com",username,password);
store.connect();
Sean

Similar Messages

  • Hi, I m using an iPhone 4 and my yahoo push email was working just fine but for the last few days I am experiencing some problem that is the emails are not getting pushed , I have to manually fetch the mails. So what could be the reason for this....

    Hi, I m using an iPhone 4 and my yahoo push email was working just fine but for the last few days I am experiencing some problem that is the emails are not getting pushed , I have to manually fetch the mails. So what could be the reason for this.....I have set the email setting to "push" mode. Moreover I can't edit the mail server address ....current it's on Yahoo SMTP server

    Will it get rectified and restored...if so after how long. What could be the reason for such outage kindly share,  as I am facing real problem because of this...

  • HT4864 I am getting a triangle with an exclamation point next to my inbox...it says: There may be a problem with the mail server or network. Verify the settings for account "MobileMe" or try again.  The server returned the error: Mail was unable to log in

    I can send but cannot recieve email
    This is the messege I am gewtting:
    There may be a problem with the mail server or network. Verify the settings for account “MobileMe” or try again.
    The server returned the error: Mail was unable to log in to the IMAP server “p02-imap.mail.me.com” using “Password” authentication. Verify that your account settings are correct.
    The server returned the error: Service temporarily unavailable

    Also if I go to system preferences accounts and re-enter the password it fixes the glitch sometimes.

  • Why do I get an "unable to connect - There may be a problem with the mail server or network." message from iCloud.  I have verified the settings.  I can access my iCloud account online but can't send or receive e-mail via the mail account.

    Text limits to the "Question" link prevents a full explanation:
    This is a long-time problem.  I have tried to resolve it with Apple but their "Customer Support" is merely a name.
    I can go online and access my e-mail but when I try to send or receive e-mail via iCloud through my internet server (Google fiber now but the same situation existed with my prior service), I receive "There may be a problem with the mail server or network.  Verify the settings for 'Apple Email' and try again.
    "The server returned the error:  The server 'p0-imap.mail.me.com' refused to allow a connection on port 143."
    Well, I have verified the setting and tried again and again and …
    Well, you get the idea …

    JungleTaxi Cabbie wrote:
    Csound1: iCloud: Configuring Mail with Mac OS X v10.6 or iOS 4
    Enter your Incoming Mail Server, User Name, and Password using the following settings:
    Incoming Mail Server: mail.me.com
    User Name: Your iCloud email address (excluding @me.com)
    Password: Your password
    Last Modified: Jun 27, 2013
    Maybe you should test these things before calling people out, because these settings do function perfectly well.
    iCloud is not supported on Snow Leopard or lower, why bother to mention it?
    The OP has an iCloud account, and that can not be opened without Lion or Mountain Lion (on a Mac), IOS5 or 6 (on an iPhone/iPad)
    The document I linked to is Apples documentation for iCloud on current devices,I don't care whether you believe that you know better than they do, but it will affect the people who follow your advice as it won't work
    JungleTaxi Cabbie wrote:
    Also, if you're not running Lion or Mountain Lion, there is no "Mail, Contacts & Calendars" prefpane.
    I never said that there was, perhaps you imagined it.

  • Strange problem with the mail app on an iPad

    I've got a bit of a strange problem with the mail app on an iPad - it's sending and receiving mail ok but won't let you delete mail. If you keep at it, it appears as if you have deleted mail (though takes a very long time as you just have to keep deleting it over and over again) -  but the size of the app still keeps going up - reached 600mb so far, even though there is hardly any mail or attachments (goes up quite a lot each time you try to delete anything) - any idea what's causing this and how I can fix it?
    It occasionally comes up with a dialogue panel saying to check my account settings, but I have checked those and they are fine. The little 'loading' icon just keeps spinning constantly too.

    go to Settings > Mail > your account > Advanced > Move Discarded Messages Into 
    and make sure that Deleted Mailbox is ticked, and not Archive Mailbox
    You can also adjust how long the deleted mail stays in the trash immediately below that.
    If you are talking about a gmail account, you may also have to login to your account on the gmail server and update the settings there.  This is what Barney previously posted about that:

  • Problem with the "mail me" button

    Since I installed both Iweb 09 and Snow Leopard, there is a problem with the "mail me" buttons on my websites. Nothing happens when i click on it even if i see my web adress when my cursor is on the button.
    Do somebody had the same problem and do you know how to avoid it.
    Thanks a lot

    I checked your site and found that the mail me button was not overlapping or touching any other object and positioned entirely in the footer of the page. All looks good and it works for me. You might try moving the button, logo and counter to the bottom of the page content section, publish and see if that makes a difference for those computers that can't.
    Try the following on your Macbook, open Safari, clear the cache (CommandOptionE), load your site and try again. If that makes it work for your MB tell your friends to clear their caches and try again. Might be something as simple as that.

  • Has there been any problems with the mail server?

    Has there been any problems with the mail server? I keep getting a notice of server failure.

    Unfortunately the error message does not identify the specific server, I (as many folks do) have several, Mac, yahoo, google ect.

  • Is anyone have a problem with the mail locking up in OS5?

    My iphone is have the Mail lock up.  I can kill it and then everything works again.  Anyone else having this problem?

    Try copying and pasting the script of the report from the old verison into a new report in 11.1.2 instead of importing the report

  • Problems with the mail server

    I needed to adjust some of the mail settings in Server 10.5.8 because I had a client that was unable to access mail.  In server Admin I selected mail and then clicked "Stop Mail."  After the screen refresh, the "Stop Mail" button reappeared rather than "Start Mail."  The status list shows Pop and IMAP shut down but lists SMTP incoming and outgoing as "shutting down."  A restart failed to resolve the problem.  I am not sure how to escape this "unholy" state.    Any suggestions?

    Look at your logs..
    /var/log/system.log
    /var/log/mail.log
    /var/log/mail_access.log

  • Problem with the Mail icon in the dock

    Hi,
    The Mail icon in the dock show me that i have 153 new mail in the little red circle, but I have none in the mail application... Does anyone know how to solve this?
    Thank you!

    hahah... wow, that was weird, there was a bunch of email marked as unread in one of my folder. But there was no way to knew it, don't have any numbers of unread message beside the folder name... anyway things are ok now.
    Thank you Mulder.
    By the way sorry my english is not very good, glad you understand me

  • HT1199 Why is mail stuck in a do-loop of "There is a problem" with the mail account after changing iCloud password?  How can it be fixed?

    After changing passwords for iCloud, Mail is stuck in a do-loop "There is a [problem..."  The error appears in less than one second after responding "Later"

    Nope.  Turns out that even though I have two Macs running 10.9.4, the one in question doesn't get the SMTP settings changed by iCloud settings when the password is changed, so I had to "Edit" the account in Mail, plow down to the password settings for the Apple SMTP server, and change the password myself.  Nothing in the System Preferences iCloud setting tab lets you change any settings on the local machine.  Apple is sure they are controlling everything when you make changes in iCloud, but they are wrong.  Identical versions of 10.9.4 are configured differently on two different Macs.

  • I am having problems with the Mail search engine.

    Here is what is happening. When I attempt to search my Mac Mail sent folders using the Mac Mail's search function, the message window simply goes blank after I enter the second letter into the space next to the magnifying glass icon. This only happens when I try to search my sent folders. It will still search my received mail folders just fine.
    I have tried rebuilding the Spotlight index, and also rebuilding the Mac Mail database. Neither worked.
    I have read some suggestions that one use Terminal with a command such as sudo hdutil -i on "/Volumes/Macintosh HD.
    Although I am loathe to type anything into Terminal, I tried to enter this command, then it asks me for my administrator password, and then refuses to allow me to enter it, so that is an entirely new problem that I would have to figure out.
    I am using OS 10.6.8 on a MacBook Pro.
    What if I just reinstall Mac Mail? Would that work?
    Thanks for your help.

    Spam filters work in different ways on different computers and different email providers, so why one message does go to the Spam/Bulk mailbox, and why it doesn't all depends on the Spam filtering criteria that that provider or product set up.
    Any messages you want that appear in the Bulk Mailbox, you would be best off learning how to train the software or the email provider that it's good mail and not spam.  Once you do that, the emails that you've been flagging as good emails will begin to come back into your normal email boxes.
    If you still need more help with this, please provide:
    1) The email software you're using on your computer, and the system software on your computer -- example: Outlook 2010 and Windows 7
    2) The email provider you're having trouble with -- example: yahoo mail, a work exchange email account

  • Apple Mail - Problems "Fetching" E-Mails

    I am trying to "Get Mail" and I see that it is attempting to "Fetch" 1 of 38 e-mails, but it looks like the first e-mail in line is clogging the delivery of the rest. Mail attempts to download the e-mails, then just gives up...
    Any sugestions on how to get rid of the e-mail that is clogging the inbox?
    Thanks in advance!
    Marcel

    Thank you so much!
    That should work, but my company changed their webhosting company and now I am waiting on the new user and pass... These logistical pieces get in the way sometime... Haha...
    In the meantime, any other options?
    Again, thank you!
    Marcel

  • My mac mail is now offline. The pop up says There may be a problem with the mail server or network. Verify the settings for account or try again. Any one know how to get my mail back on?

    I down loaded the new free os x yosemite today and now my mail is offline. Several pop ups that say there is no connection.
    Verify the settings for account or try again.
    The server returned the error: The certificate for this server is invalid.
    I have not changed a thing and now I have no emails coming or going. Since it is my communication line to many of my clients, I am in need of some answers asap.
    Thank you.

    I recently have been trying to find out why my email won't go online. A window pops up stating The identity of "pop.qwestoffice.net" cannot be verified. The certificate for this server is invalid. You may be connecting to a server that is pretending to be "pop.qwestoffice.net" putting information at risk. It asks to connect anyway? Anyone out there have a clue? I am losing my contacts with my clients.

  • Problem with the Mail receiver Adapter

    Hi,
    I am getting follwing Errors.
    Activation of the change list canceled
    Check result for Receiver Agreement
    Field compressZLIBEncryptionSignatureEncryption is obsolete  
    Field encryptionAlgorithmEncryptionEncryptionSignature is obsolete  
    Field clearDataSignature is obsolete
      Field compressZLIBEncryptionEncryptionSignature is obsolete  
    Field addCertificatesSignature is obsolete
    Field addCertificatesSignatureSignatureEncryption is obsolete
    Field addCertificatesSignatureEncryptionSignature is obsolete  
    Field SMIMEProfileApply is obsolete
      Field encryptionAlgorithmEncryptionSignatureEncryption is obsolete
      Field compressZLIBEncryption is obsolete
    Field encryptionAlgorithmEncryption is obsolete
    Any help would be appriciated
    With thanks

    not much sure abt this error: but u can check with these blogs:
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    /people/community.user/blog/2006/09/07/email-reporting
    /people/community.user/blog/2006/09/08/email-report-as-attachment-excelword
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    /people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
    will keep u posted

Maybe you are looking for

  • New Macbook Pro with Mac OSX 10.5.5 - I'm new to Mac and am having problem

    My photobooth sometimes only records videos for six seconds though it tells me it is recording for as long as I have it recording. When I click stop, what's saved is six seconds. I've had this Macbook Pro for about a month now, and I'm new to Mac, as

  • Mixing Four Tracks To One Stereo Track

    Hi, In Logic 7.2.3,if I have recorded four backing vocal tracks, all doubled up, and I want them panned across the track, from left to right, is there a way that I can submix them to one stereo track, still keeping their pan positions, so I can apply

  • Numeric value  (5-7) should return 2

    Hello. I've programmed in other language and there I could use: abs(5-7) if I want it to return 2 here and not -2. how can I do this in java? Regards

  • How to get '%' Sign in a column

    Hi, I'm trying to calculate Percentage and would like to see it's sign (%) in front of the result... Can anybody help me with sort of Column settings? Thank you. Jitendra

  • NCS 1.1 not showing any access points

    Hi,   I have NCS 1.1 appliance and added a 5508 WLC running 6.0.199.4 code using snmpv3. Controller is added to NCS, but it doesnt show any AP's which are there on the controller. AP count is zero. I have another controller with code 7.0.230 added an