wood burning stoves 2.0*
The moose likes Other JSE/JEE APIs and the fly likes How to fetch mails from my Inbox? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "How to fetch mails from my Inbox?" Watch "How to fetch mails from my Inbox?" New topic

How to fetch mails from my Inbox?

Ketan KC Chachad
Ranch Hand

Joined: Nov 23, 2003
Posts: 76
I want some help on using JavaMail API to get mails from my mailbox and process the data. Can anyone give a reference link or some sample code to do the same? Also will JavaMail APIs suffice my requirements or do I require something else to actually fetch the mail from my mailbox and give it to a program for processing? Any kind of help is welcomed.

Regards,<br />Ketan KC Chachad
Joe Ess

Joined: Oct 29, 2001
Posts: 8843

How's about starting with the JavaMail API home page? There's a FAQ and links to several tutorials there.

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Ketan KC Chachad
Ranch Hand

Joined: Nov 23, 2003
Posts: 76
Thanks for the link .... I tried one of the reading mails program given there and it is giving me the following exception

javax.mail.AuthenticationFailedException: Bad login
at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:104)
at javax.mail.Service.connect(Service.java:256)
at javax.mail.Service.connect(Service.java:135)
at com.ketan.test.MailTester.getMessages(MailTester.java:71)
at com.ketan.test.MailTester.main(MailTester.java:101)

The method where the exception is thrown is given below

The exception is thrown at the this.mstoreMail.connect( .... ); line where
  • mstrMailHostIp stores the IP address of the mail server,
  • mstrUsername stores the username to access the POP3 mail server, and
  • mstrPassword stores the password used for authentication
  • Can you suggest me where the mistake could be?
    Ketan KC Chachad
    Ranch Hand

    Joined: Nov 23, 2003
    Posts: 76
    Gee sorry my mistake .... was giving the wrong password .... it works ... thanks anyways
    I agree. Here's the link: http://aspose.com/file-tools
    subject: How to fetch mails from my Inbox?
    Similar Threads
    How to send mail to hotmail,yahoo,rediffmail?
    send email using Domino servers
    Database Synchronization...
    Doubt regarding javamail API classes (Folder and Store)
    Extracting Mail using Javamail