URGENT !!! How to fecth the content of the mail

HI All,
I having a problem regarding how to fetch the body of the mail as well as attachment of the mail.
i get sender name, subject but i having the problem how to fetch the content of the mail.
i used
System.out.println(message[msgno].getContentType());
but it showing
javax.mail.internet.MimeMultipart@480457
it won't showing the content.
How can i fetch the content !!!!
Please help
I fetching accessing the mail server using "imap"
By
Ravi
email : [email protected]

Code which i used
import java.io.*;
import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.*;
import java.lang.*;
import java.lang.Object;
public class GetMessageExample
     public static void main(String args[]) throws Exception
          String host = "...";
          String username = "....";
          String password = ".....";
          // Create empty properties
          Properties props = new Properties();
          // Get session
          Session session = Session.getDefaultInstance(props, null);
          // Get the store
          Store store = session.getStore("imap");
          // Connect to store
          store.connect(host, username, password);
          // Get folder
          Folder folder = store.getFolder("INBOX");
          // Open read-only
          folder.open(Folder.READ_ONLY);
          // Get directory
          Message message[] = folder.getMessages();
          for (int i = 0, n = message.length; i < n; i++)
               // Display from field and subject
               System.out.println("From : "+message[0].getFrom()[0]);
               System.out.println("Subject :"+message[0].getSubject());
               // Display message content     
               System.out.println("ContentType :"+message[0].getContentType());
               System.out.println("Content :"+message[0].getContent());
          // Close connection
          folder.close(false);
          store.close();
i got this output :
From : Ravi Lal <[email protected]>
Subject :Testing
ContentType :multipart/alternative;
boundary="----=_Part_63386_12145160.1189402168311"
Content :javax.mail.internet.MimeMultipart@480457
As i having only one mail in my inbox.
I able to fetch everything from, subject but i fails to get the content i.e text of the mail.......
What i do ????????
!!! Help Me !!!
Ravi
Edited by: Ravi_InSun on Sep 13, 2007 10:51 AM

Similar Messages

  • I have 5 html pages that share a common header, footer, and sidebar. how do i use my nav bar to change the content of the body without duplicating a lot of code?

    i have 5 html pages that share a common header, footer, and sidebar. how do i use my nav bar to change the content of the body without duplicating a lot of code? thank you!

    i inherited the website. It’s for a non-profit and is not very
    sophisticated, and neither am I in webdesign. It currently has multiple
    pages that are identical except for that body section, so whenever i change
    the navigation (in the sidebar) I have to update every html page.  I want
    to have one basic page, and just call in the different body content based
    on the link the user selects from the nav bar. How can i do that using a
    script? i am using Dreamweaver.
    ~ in love and light ~
    Jeannie
    On Sat, Feb 7, 2015 at 4:07 AM, Ben Pleysier <[email protected]>

  • I got some books from the itunes store and put them into my library.  I created a playlist so that I could burn them to cds.  The title is there but no contents.  It won't even play the playlist.  How do I get the contents of the book?

    I got some books from the itunes store and put them into my library.  I created a playlist so that I could burn them to cds.  It won't even play the book, there are no contents.  How do I get the contents of the book?

    I'm guessing this is a problem unique to me as there have been no replies at all...  Thanks a bunch folks

  • Hi, I have a new cell phone, I wanted to give my iphone to my father, instead of deleting the content on the iphone I have deleted the entire iphone. It starts up no more. iTunes will not recognize the iphone. How do I get my old data back onto the phone?

    Hi, I have a new cell phone, I wanted to give my iphone to my father, instead of deleting the content on the iphone I have deleted the entire iphone. It starts up no more. iTunes will not recognize the iphone. How do I get my old data back onto the phone?

    Place the device in DFU mode (google it) and restore as new.

  • How to import and make the content of the original PDF document editable and preserves the pdf appearance and retains existing fields and formatting in LiveCycle

    Can someone tell me how I can see my content (artwork and text) after I import  it into LiveCycle Designer ES4?  I like to import and make the content of the original PDF document editable; preserves the pdf appearance and retains existing fields and formatting, then allow me to do the modifications and save it back into the original PDF document with changes. I have tried everything but still cannot see my content(artwork and Text) of my original PDF after importing it into LiveCycle. All I see are is a blank page with the formatting and layout of where my artwork and text should be. I like to see everything if possible so after I make my change I will know how it will look when I save it back into the PDF and open it in Acrobat Reader.

    Can someone tell me how I can see my content (artwork and text) after I import  it into LiveCycle Designer ES4?  I like to import and make the content of the original PDF document editable; preserves the pdf appearance and retains existing fields and formatting, then allow me to do the modifications and save it back into the original PDF document with changes. I have tried everything but still cannot see my content(artwork and Text) of my original PDF after importing it into LiveCycle. All I see are is a blank page with the formatting and layout of where my artwork and text should be. I like to see everything if possible so after I make my change I will know how it will look when I save it back into the PDF and open it in Acrobat Reader.

  • How to create a jar having the contents of the jar in a byte array?

    Hi,
    I have a server and client application. My server returns the contents of the jar in the form of byte array to the client on a particluar method call. Now at the client end, i want to reconstruct the jar to be used. How do I do this?
    The server uses the JarInputStream to read the contents of the jar to be returned. I have tried using the JarOutputStream, but looks like this works fine if we have spearate class files to be added to the jar. Now that I have the contents of the jar itself, how do i recreate the jar?
    Can anyone please help me with this?
    Thanks
    Rajani

    Have you ever gotten the raw byte copy to work? If so, how?
    I download a jar via InputStream and save into a jar file via fileoutputstream. It always gets corrupted in the process. The new Jar file has the exact same number of bytes, but doesn't get past the Manifest on a -tvf. In fact, Winzip can open it fine, but can't extract. So close...yet so far.
    Here is a snapshot of my code:
    BufferedInputStream data1=new BufferedInputStream(con.getInputStream());
    DataInputStream data=new DataInputStream(data1);
    StringBuffer buf=new StringBuffer();
    try{
    while((theChar=data.read()) != -1)
    { buf.append((char)theChar); }
    } catch (Exception z){ logger.info("UpdateThread.read Done Reading jar file");}
    data.close();
    File newFile = new File("C:/MyJar.jar");
    FileOutputStream outstream2 = new FileOutputStream(newFile);
    DataOutputStream outstream1 = new DataOutputStream(outstream2);
    BufferedOutputStream outstream = new BufferedOutputStream(outstream1);
    byte [] bytes = buf.toString().getBytes();
    logger.info("Bytes of new Jar file = " + bytes.length);
    int i;
    for(i=0;i<bytes.length;i++){
    outstream.write(bytes);
    outstream1.close();
    outstream.close();
    Any ideas where I'm going wrong?

  • How to read the contents of the Uploaded file ?

    hi @,
    I have used the File upload and Download UI elements as per the tutorial available. Now my requirement is to read the contents of the file and transfer it to the Backend system.
    How can I achieve the desired fucntionality.
    Thanks in advance,
    Regards,
    Amit

    try this code to store image file in back end system.
    IWDResource res=wdContext.currentMyDataElement().getPictureres();
              InputStream in=res.read(false);
              ByteArrayOutputStream bout=new ByteArrayOutputStream();
              int length;
              byte[] part=new byte[10*1024];
              while((length=in.read(part))!=-1)
              bout.write(part,0,length);
              in.close();
    pstmt.setBytes(8,bout.toByteArray());
    If it is other than image file like word or text then try this in action
    IWDResource resource = wdContext.currentResElement().getResorce(); // your existing handle to the upload resource type
                try {
                   InputStream stream = resource.read(true);
                   byte b[]= new byte[1000];
                   stream.read(b);
                   String str = new String(b);
                   int i=str.length();
                   wdContext.currentContextElement().setOut(str);
                   wdContext.currentContextElement().setSize(i);
                   wdContext.currentResElement().setResourceurl(
                        wdContext.currentResElement().getResorce().getUrl(WDFileDownloadBehaviour.OPEN_INPLACE.ordinal()));
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    The in back end field where u store the file should be byte array.
    Regards,
    H.V.Swathi

  • Hi,I have recently replaced by hard drive with a ssd. My old hard drive has all my iTunes stuff.i would like to install only iTunes programme on the ssd with all the content on the old hard drive. How do I do it?

    Hi,I have recently replaced by hard drive with a ssd. My old hard drive has all my iTunes stuff.i would like to install only iTunes programme on the ssd with all the content on the old hard drive. How do I do it?

    Install iTunes.
    Once install, hold SHIFT and launch iTunes.
    When prompted, point iTunes to the correct location for the iTunesLibrary.itl file which should be in the iTunes folder under <user>/Music on the old drive.

  • When I plug in my ipad it automatically tries to back up and download all the contents to the C drive - the PC is too full and I have iTunes on an external hard drive, how do I tell the system to do the backup to the hard drive please?

    When I plug in my ipad it automatically tires to back up and download all the contents to the C drive - the PC is too full and I have iTunes on an external hard drive, how do I tell the system to do the backup to the hard drive please?

    You can open a command prompt by hitting the start button and typing CMD<Enter> in the search box that opens up.
    To move the current backup folder from C: to D: type in this command and press <Enter>
    Move "C:\Users\<User>\AppData\Local\Apple Computer\MobileSync\Backup" "D:\Backup"
    Where <User> is your Windows user name.
    To make iTunes look for the data in the new location type in this command and press <Enter>
    MkLink /J "C:\Users\<User>\AppData\Local\Apple Computer\MobileSync\Backup" "D:\Backup"
    If your external drive has a different letter or you already have a folder called "Backup" then edit "D:\Backup" accordingly in both commands.
    tt2

  • HT1386 How do I back up the content of the iPad on the new computer or the cloud?

    The computer I have been using for backing up my iPad died! 
    My iPad is fine. 
    All the music on the iPad came from CD's. 
    How do I back up the content of the iPad on the new computer or the cloud?

    Do this:
    - iTunes: Back up your iTunes library by copying to an external hard drive
    and restore/copy the iTunes library to you new computer.
    - Connect the iPod to the computer and make a backup by right clicking on the iPod under Devices in iTunes and select Back Up
    - Restore the iPod from that backup.
    Note that the iPod backup that iTunes makes does not included synced media like apps and music.

  • How to transfer the content of the video to Adobe Premiere Pro CS3 for editing ?

    Hi there,
    I have an old video camera that is still working. That video camera uses a Hi 8 tape. The tape is bigger that the current DV tape. The size of the tape is something like a tape cassette.
    How to transfer the content of the video to Adobe Premiere Pro CS3 for editing ? Being an old video camera, the output doesn't have any firewire or USB connector. In fact the only output is has is the Yellow, Red & while connector (is this referred to as composite).
    So, how do I input this Yellow, Red & White cable into the PC (or rather into Adobe Pro CS3) ?
    Any established hardware/convertor to recommend ?
    Thanks

    Ryan,
    For "composite out," only you will need an A-D "bridge" to Capture from that camera. Grass Valley/Canopus offers two really good ones, the ADVC-110 and the ADVC-300. There are others and also PCI A-D capture cards, but the Canopus units get very good reviews.
    One other workflow would be to hook your older camera to a digital video camera with passthrough (not all have this and it is being discontinued fairly rapidly in consumer cameras) and then doing the Capture through that digital video camera via FireWire. You will not have Device Control, but can easily start/stop via the mouse and one hand on the switches, or on a remote.
    Good luck,
    Hunt

  • How should I tag content created in a master page when addressing accessibility before exporting to Acrobat?  I can't add the content to the articles pannel because it's locked.  I would also like to know how I shold tag my cove content.  I dont' want rea

    How should I tag content created in a master page when addressing accessibility before exporting to Acrobat?  I can't add the content to the articles panel because it's locked.  I would also like to know how I should tag my cove content.  I don't want the reader to get lost in content other than the body of the report, but I also don't want to ignore some content completely by tagging it as artifacts.  What should I do y'all?
    Thanks,
    Josh

    Hi Rob,
    From the screen shots it looks like your script is not formatted properly (you may refer to 'Paladin Script' in 'Sample Project' to get an idea of how the script should be formatted.).
    Further please follow the steps mentioned below to use Story to PP workflow.
    Create a new Film script in Adobe Story
    Create  scene heading – INT. LOCATION – Day (these will show up in the outline view panel on left hand side)
    Hit enter, hit TAB
    Enter the name of the speaker, hit TAB or ENTER
    Copy over the transcribed text
    Build your script this way
    Number scenes from the production menu
    Export ASTX file for your script : File->Export->.astx
    Open Premiere Pro
    Create a new project, bring in media
    In the project pane, find the "Scene" column
    For the clip that contains the spoken text, assign the same scene number to the clip as you have in the story script (lets say both are scene 1)
    Click out of the scene box in the project panel in Ppro
    Right click on the scene that you just assigned a scene number to and select – attach Story script
    Select the .astx fle you exported in step 8
    Click ok
    You should now see the script data in the metadata panel for the clip in the metadata panel.
    You can now run speech to text based on "Embedded Script metadata" to time align spoken word to the script.
    Let us know if this is helpful.
    Thanks
    Rashi - Story Team

  • How to extract the content of a mail message?

    Friends,,,
    How to extract the content of a mail message?
    the message does not contain any attachments or images.
    its just a plain text..
    if i use message.getContent(), in addition of the content it returns headers information also...
    but i need only the content of that message...
    if i write code like this:
    String content = (String) message.getContent();
    it gives cast exception...
    if the message contains only plain text, no multipart, then which method is useful to extract only the content?
    please tell me friends..
    thanks in advannce,
    regards,
    Venkata Naveen

    Message.getContent() does not return headers for a simple text/plain
    message. If you're getting headers, something else is wrong.
    Also, casting the result to String should work.
    Most likely the message really isn't a simple text/plain message.
    Provide more details and we'll help you figure out what you're
    doing wrong.
    Also, please read the msgshow.java demo program included with JavaMail.

  • How do i split content from the text file using tab and spaces...?

    Hi.. Just want to ask help to all the experts. Im new in java and i have this problem on how to split the contents of the text file. ill show you the contents in order to let you see what i mean.
    FileName: COL.txt
    AcctNo AcctName Primary Secondary Status Opendate
    121244 IPI Company Noel Jose Active 12/05/2007
    As you can see the content i want to split it per column.. Please help me

    Jose_Noel wrote:
    Hi prometheuzz,
    What do you mean by one thread...?You created two threads* with the same question in it. That way, people might end up giving you an answer that has already been posted in your other thread: thus wasting that person's time.
    Just don't create multiple threads with the same question please.
    * a thread is a post here at the forum

  • How can i optimize my SEARCH ENGINE???I use godaddy.i contact them and they give me this conclusion:Search engines are not pulling up your other pages on your website because it is created with javascript. the content on the pages, (photo gallery.....

    conclusion from godaddy:
    Search engines are not pulling up your other pages on your website because it is created with javascript.
    the content on the pages, (photo gallery, My Recipes/Blog, History, Friends) need to be formatted to HTML, PHP or CSS. No search engines (google, Yahoo, Bing) can crawl//analyze webpages built with javascript.
    See if Apple allows iweb to create the pages in HTML format and ask how to make those changes.
    I spend more then 1 hour on the phone with them but we didn't find the solution...
    please i need help because like this nobody can rich my website...
    www.chefdiego.com
    thank you

    The part of iWeb pages that give the search engines problem is the navbar.  That's javascript based.  One way to get around that is to create another blank page in the site that's not  included in the navbar. 
    Add a text based navbar in that page with just the other pages in the site. 
    Also you can use that page for creating the sitemap for Google at Create your Google Sitemap Online - XML Sitemaps Generator.
    Have you let Google know your site exists? This website describes how to get it recognized: Get your iWeb website found in search engines like Google Yahoo MSN and Bing.
    OT

Maybe you are looking for

  • SQL Server Agent Failed to decrypt protected XML node

    I'm getting the below error when trying to run sql server agent to run an SSIS package. I've updated folder security to allow sql server agent access, but cannot get the package to execute within SQL Management Studio. The package runs find in SSIS. 

  • Looping Problem

    I'm kinda getting confused with my program, my loops are going crazy on me! HELP! I'm posting my whole code, so you can try the program yourself: import java.io.*; import java.io.BufferedReader; import java.util.Vector; import java.util.Iterator; imp

  • Zen Vision:M's accessories that allow to play movies on TV scre

    Is there any accessories for Vision:M that will allow me to play movies from Vision:M but displayed on TV? I really would like to play movies I have on Vision:M but watch it on standard TV instead. Thanks in advanced, Nattawat

  • Update access table

    Hi guys I get a problem I try to update my access db via a servlet but I all time get an exception like : java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Check.projet=Certification

  • Cables for outputting video to tv

    are there any apple cables or any other cables that are capable of outputting video from a macbook to an hdtv. I have a HDTV with only component connections so maybe a dvi to component converter/cable? i have no idea, any help is appreciated. Thanks