• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading email attachments?  RSS feed

 
Andrew Mcmurray
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • 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
 
Paul Clapham
Sheriff
Posts: 22828
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • 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
  • 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
Sheriff
Posts: 22828
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!