• Post Reply Bookmark Topic Watch Topic
  • New Topic

JavaMail Problem.

 
Rohit Ahuja
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was just wondering whether i can get the name of an attached File.If yes, how do i go about it ?
 
Rohit Ahuja
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a bounced mail when i send it to an invalid e-mail id.
The bounced mail then has an eml attachment which is nothing but a copy of my text in my mail when i sent it the first time.
I need to get the name of this eml attachment, is it possible in javamail?

i need a quick solution to this...


Thanks,
 
Naren Chivukula
Ranch Hand
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need a quick solution to this...


It seems you are new to java ranch. Go through this link.
How to ask questions in Java Ranch?

You can get attached file and it's name. Firstly get the Multipart of the mail and get the BodyParts. One of your mail's BodyParts will contain File attachment. Use getFileName() and getInputStream() on the bodypart object and save the file.

Best Regards,
Narendranath
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!