aspose file tools*
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
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
Author

How to fetch mails from my Inbox?

Ketan KC Chachad
Ranch Hand

Joined: Nov 23, 2003
Posts: 76
Hi,
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
Bartender

Joined: Oct 29, 2001
Posts: 8971
    
    9

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


[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?