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.

Similar Messages

  • How to extract the contents of the Jar file?

    Hello,
    Can anyone tell me how to extract the contents of the Jar file?
    An example will be highly appreciated.
    Thanks.

    From command line, or from within a java application?
    Kaj
    Btw. Why do you need to do it. You do know that you can add jars to the classpath and read resources from them without extracting the file?

  • Since installing OS X 10.9 some (not all) of my mailboxes have lost the contents of their mail messages. Can I restore them?

    Since installing OS X 10.9 last week, my Mail app is malfunctioning. I can no longer read the contents of old mail messages in some of my mailboxes. Others are fine. Can I restore them?

    As EtreCheck just provides a snapshot in time, it is not terribly useful for figuring out what is slowing the system down unless you have known bad actors running on your Mac that show up in the report.
    You need to watch Activity Monitor when it slows down and see what is chewing up CPU and Memory.
    If the Memory Pressure gets into the Red while using it, then it is likely not enough RAM for what you are trying to do. With the check you posted above, you weren't having any memory issues at that moment.
    You've got a handful of startup items which I know nothing about. Try disabling them and see if things are better.
    User Login Items:
        WBE Desktop Notifier
        WorkspaceUpdate
        iTunesHelper
        AdobeResourceSynchronizer
    And
    [loaded]    com.starfield.backupservice.plist 3rd-Party support link
    You can test by booting into Safe Mode. If it works reasonable well there, it is likely one of the startup or login items.
    If not, I would agree with others that it is the lack of RAM.

  • How to fecth the contents of a mail from the server by using jsp

    hi
    Can any body tell me how to fetch the contents of mail from the server by using javamail api...please send me code if some one have
    bye.

    hi
    Can any body tell me how to fetch the contents of mail from the server by using javamail api...please send me code if some one have
    bye.

  • How to extract the contents of ZIP file stored in oracle database column ?

    The file is in ZIP format and it is stored in BLOB databse column . The contents of file is in binary format .
    How to extract those contents from file and thus creating the same ZIP file as output in ODI ?
    Thanks
    Arun

    Perhaps you can something like what is described in the support note "How To Load A PDF File Or Other Binary Files To a BLOB Column From ODI (Doc ID 1412753.1)"

  • How to extract the content of a user uploaded txt file in web dynpro?

    Hi,
    I'm working on a java web dynpro component. This component consists of document upload field, where users should be able to upload .txt documents. These uploaded text documents should then be somehow read, and thir content displayed. I am already able to upload documents using the upload field, and store it in the context, but I'm still not able to extract the content of these text documents for displaying.
    Does anyone have any suggestions of how I could do this?
    Any help will be greatly appreciated!
    Thanks!

    Hi Alain,
        You can do through this document on how to upload/download files in Webdynpro.
    [https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/202a850a-58e0-2910-eeb3-bfc3e081257f]
    Once you have the uploaded file in your context if you are storing it as a byte array then convert it to a string using the String constructor String(byte[] bytes)  and then you can store this string in an attribute of type String which could be bound to a UI element (TextArea) to display the contents.
    If you are using an IWDResource then you will get an inputstream from which you can read the data and convert it to a string for display as mentioned above.
    Hope this helps.
    Sanyev

  • How to Read the content of E-mail Body data

    Hi All,
    I am creating an E-mail webdynpro application, In that i want to read the content of body part. what will be the type of that TEXTEDIT field?
    and how can i read the content ?? is there any method or function module for that ???
    Thanks.

    Hi,
    There is standard WDA available on sending Emails. It is RPLM_MP_SENDEMAIL_COMP.
    See the code in this WD application and get the relevant logic for your functionality.
    I hope this will solve your problem.
    Thanks,
    Chandra

  • How to Extract the content of a message?

    Friends...My Message contains both body and attachments...
    But while extracting, it returns content (body text) as null..but body is there..
    attachments are coming properly...
    If attachments are not there, it display the content properly..
    im giving my code please check what s problem in that? please...
    Object obj = msg.getContent();
    if (msg.isMimeType("multipart/*"))
                 Multipart multipart = (Multipart) obj;
                 int       count     = multipart.getCount();
                 for (int j = 0; j < count; j++)
                        Part        part = multipart.getBodyPart(j);
                        String      sct  = part.getContentType();
                        ContentType ct   = new ContentType(sct);
                        if (ct.match("text/plain") || ct.match("text/html"))
                            System.out.println("The content is " + (String)part.getContent());
                        String disposition = part.getDisposition();
                        if ((disposition != null)
                                && (disposition.equals(Part.ATTACHMENT)))
                            System.out.println("File Name is " + part.getFileName());
    Sandhya Komali

    Your mail server could be broken. What protocol are are using -
    pop3 or imap? What server (what vendor) are you using?
    Can you post the protocol trace when accessing
    such a message?
    Also, you might consider using the Part.isMimeType method
    instead of ContentType.match, it will make your code simpler
    (but is unrelated to your problem).

  • HT2954 How to search the content in Mac mail system?

    I receive a lot of emails each day, some of the are dumped in the inbox. It is natural to search them later by typing some keywords. But the search engine performance is very bad compared to the the one of Gmail. I typed the same words, Mac mail showed there is no results. But Gmail gave almost all of them.

    Hi, for my money, Spotlight is the worst serch engine since "Don't Find this.app"
    But, are there options showing for From, To, Content & such?

  • How to extract the content of a section using VBA?

    For example, I have an article like this:
    Abstract
    AbstractParagraph1
    AbstractParagraph2
    Body
    BodyParagraph1
    BodyParagraph2
    Reference
    ReferenceParagraph1
    ReferenceParagraph2
    Knowing that Abstract, Body and Reference are all headings, which means if I click the triangle button on the left of the heading (For example, Abstract), AbstractParagraph1 AbstractParagraph2 will shrink or expand. So my question is: how to retrieve the paragraph
    in a specific section using VBA?

    Hi UW,
    >> how to retrieve the paragraph in a specific section using VBA?
    In my option, you could use the Section Object (Word) to get the section object, and then use the Section.Range Property (Word) to get the content of the special section. The links below might be useful to you.
    # Section Object (Word)
    https://msdn.microsoft.com/en-us/library/office/ff194295.aspx
    # Section.Range Property (Word)
    https://msdn.microsoft.com/en-us/library/office/ff836097.aspx
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • How to extract the contents fo .xsl files

    wanna source code to extract and Modify the contents of .xsl files

    Duplicate of http://forum.java.sun.com/thread.jspa?threadID=635711&tstart=0

  • HELP - The content in my mail messages has disappeared

    HELP -I've been trying to organize hundreds of messages (sent and received) so I've been creating mailboxes and submailboxes, without problem except for the occasional (you can not move this mail) message which I have not understood.
    I just created a submailbox and moved about 50 messages there which had a common topic. All of the messages are listed in the top window (with title date and time received), but the contents are gone. The only thing in the lower window is the same message for each email:
    "The message from Executive Producer <[email protected]> [OR WHOEVER THE SENDER IS] concerning “studio feasibility?” [OR WHATEVER THE TITLE OF THE MESSAGE IS] has not been downloaded from the server. You need to take this account online in order to download it."
    HELP. Are these messages gone forever? Can I get them back? What did I do wrong?
    PS - I'm still receiving new messages, so the account is online. And the messages are from a few different accounts to a few different email addresses of mine (and vice versa), but they are all blank.

    Ernie,
    Mail allows the same folder to behave as both a mailbox and as a parent folder for other folders. Each aspect of this duality is supported by a different folder in the filesystem (.mbox suffix for the mailbox, no suffix for the parent folder), even though it appears as a single folder in Mail.
    When the user creates a new folder by means of Mailbox > New Mailbox, Mail assumes it’ll be used as a mailbox (as the name of the command indicates) and the .mbox variant is created in the filesystem. If the user later creates or moves other folders within this folder, Mail creates the no-suffix variant in the filesystem and puts the subfolders there, but nothing appears to change in Mail itself.
    Folders appear blue in Mail as long as there exists an associated .mbox folder in the filesystem, regardless of whether a corresponding folder without suffix exists as well. Only folders that don’t have an associated folder with an .mbox suffix in the filesystem appear white in Mail. That is, a folder appears blue in Mail as long as it can behave as a mailbox (i.e. store messages of their own), and white if it can only be used as a parent folder for other folders.
    Problem is, Mail doesn’t handle this duality very well. I always recommend users to use each folder as either a mailbox or as a parent folder, but not both. From what I’ve seen reported here many times, “taking advantage” of the duality is calling for trouble, e.g.:
    Mail - lost mail - driving me mad

  • How to get the content of a SOAP Message !

    Hi,
    i have a SOAP message wich has inside some information in xml format; how can i get the xml from the message ?
    Cheers.
    Stefano

    use java.xml.soap.
    Then the following:
    SOAPPart sp = soapMessage.getSOAPPart();
    SOAPEnvelope se = sp.getEnvelope();
    SOAPBody  sb = se.getBody();And voila, sb holds your XML document :)
    good luck!

  • How to increase the viewing size of Mail messages

    Hi, All
    I am using Leopard 10.5.4. and new to Mail.
    I would like to set my message font size to size 10 for composing and reading incoming mail. However, when I am composing a message or reading an incoming message that is in size 10, its incredibly small. So I have to set it in font 12 in Mail preferences just to read it. But then when the mail goes out, its in font 12. Is there someway I can increase the view (like 100%, 150%) without changing the font size? I tried the COMMAND+ but it becomes blurry.
    Thanks in advance.

    I'm going to assume you are using the latest version of iPhoto. After you've chosen which photo(s) to email click Share > Email from the menu. Once you done that there's a button in the lower right corner where you choose the size of photo you want to send.

  • 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

Maybe you are looking for

  • Smartform Problem in Displaying a string data

    Hi Friends,                  I am facing a problem while displaying a string data in smartform. Actually it is a one of the field's data in an internal table. It is a STRING field type of length 0. While populating in an internal table it is having a

  • Are there installations that do not require an Administrator Password?

    I just installed the Camino web browser onto Leopard. I was suprised when Leopard did not ask for an Admin Password when installing it. I then simply downloaded another program and was able to install it without the Admin prompt. Leopard DID let me k

  • Why don't rag doll games work in osx?

    My grandson likes to play train mania in rag doll games on line and we are having a problem.

  • How to run Eclipse in a Linux machine?

    hi guys, I have worked with Eclipse3.0 under windows platform. but then can i know how to run Eclipse in a Red-Hat Linux machine, if yes, then please do elaborate the same. thank u. Cheers, vishal j

  • Why won't Firefox retain any history, save bookmarks, or save changes?

    Back when I tried updating Firefox 3 to 6, I was prompted to input the administrator password (as I was installing it on another user). I exited out rather than input it, but Firefox updated anyway. The next day, after turning in my laptop again and