• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to fetch mails from my Inbox?

 
Ketan KC Chachad
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Joe Ess
Bartender
Posts: 9295
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How's about starting with the JavaMail API home page? There's a FAQ and links to several tutorials there.
 
Ketan KC Chachad
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
    Posts: 77
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Gee sorry my mistake .... was giving the wrong password .... it works ... thanks anyways
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic