Results 1 to 2 of 2
  1. #1
    kib_tse is offline Member
    Join Date
    Aug 2008
    Rep Power

    Default error in reading mail contents

    I am developing java mail application.i want to read mail from java E-mail server(JES).i used the method getcontent() like this
    System.out.println(message[i].getContent()); but i am geting the out put
    "avax.mail.internet.MimeMultipart@b1cd0" which is not the mail content.i tried message[i].WriteTo(System.out); but it is giving me all the unecessary content like
    messae-id,message version,content-type,encoding-type,contern decsription.
    but i don't want them. i want only the body and the attached file.So
    please help me how to read it.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    On vacation
    Rep Power


    the out put
    The text of that message looks like an object of type: MimeMultipart is being returned by getContent()
    Check the API doc for getContent() to see what it returns.
    If it returns an object, you'll need to cast that object and you can then use its methods to get its contents.

Similar Threads

  1. Replies: 2
    Last Post: 05-05-2008, 06:01 AM
  2. Reading file contents (BufferedReader)
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-07-2008, 10:00 AM
  3. reading from a zip file, error
    By Mr tuition in forum AWT / Swing
    Replies: 1
    Last Post: 01-16-2008, 01:39 AM
  4. Reading web contents
    By javaplus in forum Networking
    Replies: 2
    Last Post: 11-29-2007, 11:28 AM
  5. Mail error
    By orchid in forum New To Java
    Replies: 1
    Last Post: 04-22-2007, 02:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts