title: How to get filename of all attachements of email?
body: <p>I am trying to get the filename of all the attachements of emails using java and imap.My code is:</p>
  
  <pre><code>MimeMessage msg = (MimeMessage) messages[i];
  String fileName = msg.getFileName();
  System.out.println("The file name of this attachment is " + fileName);
  </code></pre>
  
  <p>but it prints null always even if email contain attachment..I have seen different codes on SO but none worked...and I don't know what to do if attachment is more than one .<br/>
  PS:I only want to get the filename and don't want to download attachments.</p>