• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Java Batch To Read Mailbox And Fetch The Mail Contents

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am trying to design a Java Batch program which will monitor a particular mailbox in MS outlook , and if a new mail is received it should process the mail
and fetch the attachment which is an excel sheet and process the content of the excel sheet and load it to MSSQL database.

I know how to process Excel using java but confused on which design or API I need to use for monitoring mailbox.
Could you please share some high level idea on this... Thanks !!!



 
Saloon Keeper
Posts: 7093
165
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The API for handling mail is called JavaMail. I suggest to start with familiarizing yourself with that: how to access mail, how to retrieve new mail, how to determine which messages have attachments etc. Only then add handling of attachments (how that's done has nothing to do with mail processing as such).
 
murali jackson
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Tim !!!
I will check this API and post here if i have any further doubt...
 
murali jackson
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have googled about Java mail API and used below sample code to connect to my outlook mailbox but it is showing connection failed.
Dont know whether im passing the parameters wrongly. Im sure that my username and password is correct.

Please throw some light on this.



Error is below :



 
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's a long time since I used JavaMail so I'm a bit rusty but the code looks ok to me.

The exception says it can't connect to the message store due to an invalid address so I'd check the host address you are using.
 
murali jackson
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,

Now Im able to connect to the host but its throwing certificate chaining error.
When I googled about this error, suggestions was like i need to import certificates to my WAS server.
But this is standalone application which i have not published to any server. So don't know how to proceed.
Please advise.




Error is below

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic