Win a copy of Head First Android this week in the Android forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

JavaMail Problem.

 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Ranch Hand
Posts: 577
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic