• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reading email attachments?

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

I need to read excel files from an email attachment. I can read the file once I got a hold of it, but I don't know of a way to get the file. Is there some sort of email lib or something that I can use to check to see if a message has arrived and then pull the excel file off the message?

Thanks,

AMD
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, it's called JavaMail. Googling this word should get you downloads, tutorials, and be sure to read the FAQ.
 
Andrew Mcmurray
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Paul,

I will give it a look.

AMD
 
Andrew Mcmurray
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok I got JavaMail and when SSL is turned off it works fine to connect, when it is on it won't work. I tried some code I found online, but we do not have a cert we only use it for encryption. So I get an exception about not having a cert. Any thoughts?

Thanks,

AMD
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'll say first that I'm not an expert at working with certificates and public and private keys, but I do know that to encrypt data, you do need a private key, and you need to have a keystore set up correctly.

Did you mean that you only need it for decryption (since you were talking about reading an attachment in an encrypted mail)? If so, then you need to have the keystore set up with certificates and public keys of the sending party.

Maybe this will help: Secure JavaMail with JSSE (although it's already an old article from 2001)
Java Secure Socket Extension (JSSE) Homepage (look at the documentation, you can find a JSSE Reference Guide for Java 1.4 and 5.0 there)
[ February 09, 2007: Message edited by: Jesper Young ]
 
Andrew Mcmurray
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jesper,

I think I need it for the encryption of the user name and password sent to connect to the mail server. When my system admins turn off ssl on the mail server it works fine, they told me that I can't pass the user name and password in the clear.

Thanks,

AMD
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your JavaMail download includes a file named SSLNOTES.TXT; does that not have an answer for your question?
 
Andrew Mcmurray
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Paul,

I read the SSLNOTES.txt and I think it just confused me more. It looks like I need to create a Trust Store?

Thanks,

AMD
 
Andrew Mcmurray
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok I created the DummyTrustManager and DummySocketFactory. Now when I try to have the store connect I get a Unconnected sockets not implemented?

Any thoughts?

Thanks,

AMD
reply
    Bookmark Topic Watch Topic
  • New Topic