Receive multipart message for IMAP  protocol

I need receive content of multipart (not plain text) message with IMAP protocol.
this code correct for POP3 and IMAP paintext message only:
Part messagePart=message;
Object content=messagePart.getContent();
if (content instanceof Multipart) {
messagePart=((Multipart)content).getBodyPart(0);
System.out.println("[ Multipart Message ]");
String contentType=messagePart.getContentType();
System.out.println("CONTENT:"+contentType);
if (contentType.startsWith("text/plain")
|| contentType.startsWith("text/html")) {
InputStream is = messagePart.getInputStream();
BufferedReader reader
=new BufferedReader(new InputStreamReader(is));
String thisLine=reader.readLine();
while (thisLine!=null) {
System.out.println(thisLine);
thisLine=reader.readLine();
any ideas?
Thanks.

You will find a better example, which looks at the parts recursively, if you look in the "demo" directory of your JavaMail download. I think it's msgshow.java but there aren't that many to choose from.

Similar Messages

  • R11:RECEIVED ERROR MESSAGES FOR AP INVOICE APPROVAL IN ORACLE WORKFLOW

    Hi All,
    We have this error:
    ### Detailed Problem Statement ###
    Received the following error messages in sysadmin notifications:
    Event Error Name: 100
    Event Error Message: ORA-01403: no data found
    Event Error Stack: HZ_DQM_SYNC>REALTIME_SYNCH(oracle.apps.ar.hz.DQM.realtimesync,
    30665979B704AE043C0A81404B04A)
    Event Error Name: WFE_DISPATCH_RULE_ERR
    Event Error Message: [WFE_DISPATCH_RULE_ERR] ENAME=oracle.apps.ap.payment EKEY=10001
    RULE=ap_payment_event_wf_pfg.rule_function SQLCODE=100 SQLERRM=ORA-01403: no
    data found
    Event Error Stack: WF_Event.dispatch_internal()
    In addition, during the set-up of Oracle Approvals Management, there was no available list of
    values in the Notification Style in the workflow configurator page.
    Action Plan
    =======
    1) Confirm if the workflow is customized in any way.
    2) Confirm whether you are able to select global preferences for the other invoices approval, meaning are you
    getting the list of values for the other invoices.
    There are no workflow customizations. We are trying to implement it to AP invoice
    approval only.
    Can you instruct me on how to test this one? I thought I could only select the global preferences from the workflow configuration window. And there are no distinction as to which invoice approval
    process it is applicable. Where could I select the global preferences for other
    invoices approval?
    Thanks a lot

    thanks hussein , but still we can not see LOV values even if we inserted data manually...:(
    But it has improved and we moved on to another error which is:
    *****received the error message:3120: Activity 'APINV/52822' has no performer
    ### Problem description or inquiry details ###
    Received the following error message:
    Error Message
    3120: Activity 'APINV/52822' has no performer.
    Error Stack
    Wf_Engine_Util.Notification_Send(APINV, 115191_1, 52822, APINV:APINV_MRA) Wf_Engine_Util.Notification(APINV, 115191_1, 52822, RUN)
    Encountered the following:
    No list of values in the notification style field in the global configuration region in the Workflow Configuration Page
    Please note that we could not update the workflow configuration page using the forms because there
    is no list of values to select in the above-mentioned field. We just recently
    changed the workflow administrator role from SYSADMIN to KCAALIM to reduce
    changing of user log-in. We have previously used the sysadmin user log-in to
    access the workflow configuration page. there was still no list of values for
    the notification style. we changed the wf admin role to kcaalim using the sql:
    udpate wf_resources set text = 'KCAALIM' where name like 'WF_ADMIN_ROLE';
    Commit;
    Hence, changing of wf admin role and user log-in (to sysadmin) won't help (just in case you would advise me to do so) since we tried it
    already.
    ### Responsibility and navigational paths to reproduce ###
    1. set-up the AME for ap invoice approval.
    2. test an actual transaction.
    3. when the list is generated, set-up workflow for AP approval.
    when setting up the configuration page, there is no list of values available for the notification style. hence the workflow
    configuration could not be updated.
    4. Run the required programs (i.e., synchronizations)
    5. run the approval workflow from the developer studio page.
    6. review the status from the Status Monitor page.
    7. The error message appears
    8. payables, create a sample invoice.
    9. validate and initiate approval.
    10. review the approval history to find out the required approver. (the approver's name appears with 0 amount of approval)
    11. check the notifications in the required approver's worklist.
    12. there are no notifications sent.
    Text continued in next action...
    **** screen shots availble >http://rapidshare.com/files/176008682/error_-noperformer.doc.html
    Thanks again...

  • Why won't I received OVI messages for free apps th...

    Hi
    I have a Nokia C6 Telstra prepaid phone and on my PC I went to the OVI store and selected free apps to be sent to my phone so I can download/install. However, its been many many many hours and I still receive nothing.
    What is wrong?????
    If someone can help it would be great.

    I can only assume.
    1) Server is busy, it did take about 2 hours for one app SMS to arrive at my phone once.
    2) You made some error in the number format, either country code or leaving the zero in.
    3) Your operator is blocking those message?

  • HT204409 i'm receiving a message for unable to join the network when entering in the wifi password

    the message I'm receiving on the Ipad mini when entering the home network password is: Unable to join the network!!!

    If you are having WiFi problems it is necessary to isolate whether the problem is with your network or your iPad. Note: Do NOT consider your network to be blameless if some other devices can connect to it.
    First, test your iPad on some other networks: a friends, Starbucks, Barnes & Noble, etc.
    If it works well there then the problem is probably with your network. Try restarting your WiFi router by removing power for 30 seconds. If that does not help check for a firmware update for your router. If none exists which corrects the problem consider replacing the router.
    If your iPad does not function well on other networks it possibly has a hardware problem. Contact Apple Support or visit an Apple store for evaluation. They can provide a replacement if your iPad is bad.
    If you need more help please give the make, model, and version of your WiFi router and how you have it configured.
    See also here: http://www.apple.com/support/ipad/wifi/

  • "Invalid Credentials" Message for IMAP Gmail

    When I tried to update my Gmail on my phone this morning, I got a message that said "Cannot Get Mail, Invalid Credentials (Failure)". I thought something had happened with the password, so I reentered it, but I got the same message. I deleted the account and reentered all of the email settings and I still got the same message. I've checked the IMAP settings on Gmail and nothing has changed there. I can update this account on my iMac and I can sync another Gmail account my iPhone so it seems there's something specific about this account on my iPhone. Any ideas?

    As soon as I posted my question, the account started working again.

  • Only in Firefox Ver. 7.0.1, receive error message for one site only " Tired help advice -didn't workAn error occurred while displaying this page"

    The above error message suddenly appeared trying to load Schwab.com. Couldn't get help to solve problem. Uninstalled Firefox and then downloaded fresh version - still doesn't. Note I have McAfee security suite installed. Performed Delete of Firefox and then reinstall - still no help

    Download Microsoft Visual C++ 2005 Redistributable Package (x86) at
    http://www.microsoft.com/downloads/details.aspx?FamilyID=32bc1bee-a3f9-4c13-9c99 -220b62a191ee&DisplayLang=en
    It should fix the sidebyside errors. It did for me.

  • I downloaded Babylon translator and it took the control on my Firebox, then I erased both. Now, when i try to download Firebox again I am receiving a message for the set up "run with an other administrator" and it is impossible to run the Firebox exe

    I download the Firebox 7 from the Mozilla webpage. Once I get the Run Exe and I press run, after 30 seconds i receive a new frame asking me to run the exe with another administrator in my laptop.

    Drrhythm2 wrote:
    What's the best solution for this? I
    Copy the entire /Music/iTunes/ folder from her old compouter to /Music/ in her account on this new computer.

  • Seeburger AS2 Adapter:  Receiving multiple messages

    Hi guys,
    I'm having some trouble using AS2 Adapter for receiving multiple messages. The problem is really similar to Peter's problem.
    Seebuger AS2 adapter for XI as sender for multiple messages
    I have it configured for one scenario and it's working fine. The problem is when I'm trying to receive other messages for the same Party but different services. Meaning, I've one Party(example BMW) and several services (BMW_DE, BMW_USA, etc). I'm able to receive messages from service BMW_DE but when configuring BMW_USA I'm getting HTTP 403 Forbidden.
    This error may have different reasons:
    a) You or your partner has entered an incorrect AS2 ID for one of the involved parties.
    b) A valid sender agreement is missing.
    c) There are more then one AS2 sender agreements with the same sender AND receiver party.
    d) The corresponding inbound channel is set to inactive.
    And the problem is that there are two sender agreements. Although the services are different, XI is not able to find the correct sender agreement to be used. After deleting the second second agreement, I'm able to send the  respective message....
    Can anyone give me a hint on how to solve this problem?

    Hi,
    this is done by different AS2 subjects. The sender agreement is selected based on this. So create separate AS2 receiver adapters for every message you need and put there different message subjects.
    So if you'll have 3 AS2 receiver channels with subjects:
    MessageType1_DE
    MessageType1_US
    the AS2 adapter will work like following:
    first it tries to find an exact message subject, if it is found, message is "assigned" to this sender agreement. If no exact message matches the subject, then wildcards are used. (this mechanism is described in the Seeburger AS2 guide).
    If you are getting 403 HTTP code, there may be also problem with authentication certificates.
    Another problem may be, you don't have configured AS2 receiver channel for current subject.
    Does this help you? Or you meant it another way?
    Peter
    p.s. check the answer above my post, Vardharajan's right
    Edited by: Peter Jarunek on May 19, 2008 2:11 PM

  • Daily I receive a question for updating my Firefox (s.6.17 MacOs), but when I agree the result is Or no contact with the update-server

    Daily I receive a message for updating my Firefox (3.6.17 MacOs 10.6.8) but when I agree, it takes quite a long time and then OR a message: no contact with the update-server OR something like: Sorry we cannot find xxxxx(?!).
    QUESTION: HOW TO UPDATE?
    [By the way: what about version 8.0! Is that perhaps for mobile-systems?
    With regards, Jan Stevens.

    If there are problems with updating or with the permissions then easiest is to download the full version and trash the currently installed version to do a clean install of the new version.
    Download a new copy of the Firefox program and save the disk image (dmg) file to the desktop
    *Firefox 8.0.x: http://www.mozilla.com/en-US/firefox/all.html
    *Trash the current Firefox application to do a clean (re-)install
    *Install the new version that you have downloaded
    Your profile data is stored elsewhere in the Firefox Profile Folder, so you won't lose your bookmarks and other personal data if you uninstall and (re)install Firefox.
    *http://kb.mozillazine.org/Profile_folder_-_Firefox

  • I need help with my iTunes audio configuration, its been giving me error messages for 3 weeks now!!!!

    I have been receiving this message for 3 weeks now," iTunes has detected a problem with your audio configuration. Audio/Video playback may not operate properly." I've tried uninstalling and even deleting my quicktime player and then installing it again. I've also tried uninstalling and deleting my itunes and then redownloading it again. I have also made sure that both are up to date, but still it gives me that **** error message. I cant listen to any of my songs or any new songs, please help.

    I have been receiving this message for 3 weeks now," iTunes has detected a problem with your audio configuration. Audio/Video playback may not operate properly." I've tried uninstalling and even deleting my quicktime player and then installing it again. I've also tried uninstalling and deleting my itunes and then redownloading it again. I have also made sure that both are up to date, but still it gives me that **** error message. I cant listen to any of my songs or any new songs, please help.

  • Why can't I receive text messages on my Iphone 6 plus

    I haven't been able to receive text messages for two days

    iOS: Troubleshooting Messages
    If the above link doesn't help, then contact your phone carrier as SMS is their feature.

  • Could send, but not receive SMS messages until today - Can I retrieve the SMS messages that never came in?

    I didn't realize until today, but I haven't been receiving SMS messages for two weeks.  I'm pretty sure it started when I sent an MMS message. People have been getting my messages, but I haven't received any SMS sent to me.  Today I reset my phone and was able to receive an SMS that I asked someone to send. 
    Is there any way to retrieve the SMS messages from the last two weeks that didn't come in on my phone?
    I have a Curve 8900

    Hi,
        As far as sms r concerned, that were sent to u around 2 weeks ago cannot be retrieved because of the reason that sms do have a time period for being delivered,else r self destroyed.
    In other words, suppose a sms has 24 hrs time for delivery and for any reason the sms is not  being delivered in that given time period to the specified number, then the sms will automatically get erased/destroyed depending on the netwrok provider.
    Sorry for ur loss... 
    with regards
    simply abhik...
    Please click "Accept as Solution" if your issue has been solved and to give thanks/appreciation, click thumbs up...
    For BB OS update: http://us.blackberry.com/software/smartphones/update.html
    BB Simulators: http://us.blackberry.com/sites/developers/resources/simulators.html

  • On my iPhone 5 I am having a problem sending / receiving e-mails and am receiving the message: the user name or password for "imap.gmail" is incorrect. Despite many attempts I am getting nowhere. Does anyone recognise this problem?

    I am having a problem sending/receiving e mail messages on my iPhone 5 and cannot access my account. The message I am receiving is: The user name or password for "imap.gmail" is incorrect.
    I do not know what imap.gmail is. I have also lost data which was contained on my diary which I believe is linked to the problem. Does anyone recognise this problem?
    Cheers,
    Morred

    Morred wrote:
    I am having a problem sending/receiving e mail messages on my iPhone 5 and cannot access my account. The message I am receiving is: The user name or password for "imap.gmail" is incorrect.
    I do not know what imap.gmail is. I have also lost data which was contained on my diary which I believe is linked to the problem. Does anyone recognise this problem?
    Cheers,
    Morred
    imap.gmail is the Google mail server. It doesn't recognize the password that is stored in the iPhone. The problem is that the password or email address you have in Settings for the gmail account is wrong. If you changed the password somewhere else that is the reason. You need to go to Settings/Mail,Contacts,Calendar, tap on the gmail account and enter the correct password. You also need to change it for outgoing mail in Settings.

  • Cannot Read Body Parts for certain messages on IMAP Server

    Hi There
    I get the following exception on some (not all) messages when trying to extract and save body parts from an email message on the IMAP server. I can iterate through all the body parts, get the filenames, etc. but when I try to read them I get the following error. Any ideas?
    It is MS Exchange (not sure what version) and seems to happen more when there are multiple file attachments or embedded images. We also have a POP3 option and this seems to work fine, only fails when using IMAP...
    java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
    DataHandler dh = bodyPart.getDataHandler();
    dh.writeTo(baos); // <=== Exception here
    TYPE=TEXT/PLAIN; name="New Text Document.txt"/Disposition=attachment
    java.lang.NullPointerException
         at com.sun.mail.iap.Response.parse(Response.java:130)
         at com.sun.mail.iap.Response.<init>(Response.java:87)
          at com.sun.mail.imap.protocol.IMAPResponse.<init>(IMAPResponse.java:48)
         at com.sun.mail.imap.protocol.IMAPResponse.readResponse(IMAPResponse.java:122)
         at com.sun.mail.imap.protocol.IMAPProtocol.readResponse(IMAPProtocol.java:230)
         at com.sun.mail.iap.Protocol.command(Protocol.java:263)
         at com.sun.mail.imap.protocol.IMAPProtocol.fetch(IMAPProtocol.java:1234)
         at com.sun.mail.imap.protocol.IMAPProtocol.fetch(IMAPProtocol.java:1226)
         at com.sun.mail.imap.protocol.IMAPProtocol.fetchBody(IMAPProtocol.java:994)
         at com.sun.mail.imap.protocol.IMAPProtocol.fetchBody(IMAPProtocol.java:983)
         at com.sun.mail.imap.IMAPBodyPart.getContentStream(IMAPBodyPart.java:169)
         at javax.mail.internet.MimePartDataSource.getInputStream(MimePartDataSource.java:94)
         at javax.activation.DataHandler.writeTo(DataHandler.java:297)
         at com.workpool.interactionservices.EmailMessageUtils.saveBodyPartToFile(EmailMessageUtils.java:250)
         at com.workpool.interactionservices.EmailMessageMimeConvertor.processBodyPart(EmailMessageMimeConvertor.java:305)

    I presume the work around you refer to is to make a copy
    of the message? That's all I could find in the FAQ under
    IMAP. I'll try that.
    Unfortunately the server is sitting with a client on their LAN
    and we don't have remote access for debugging. We don't
    currently have a way to easily enable debugging for testing.
    Getting access for testing can take a few days ... but I shall
    do this if the work around does not work.

  • Unable to send or receive messages for the Btinter...

    Hello
    I use Windows Live Mail to download my emails. This is working fine on two computers for other BT Internet and Gmail accounts. But one of my main BT accounts consistently receives the following messages on both computers:
    Unable to send or receive messages for the Btinternet (xxx) account. 
    Server Error: 0x800CCC90
    Server Response: -ERR inactivity timeout
    Server: 'mail.btinternet.com'
    Windows Live Mail Error ID: 0x800420CD
    Protocol: POP3
    Port: 110
    Secure(SSL): No
    Unable to send or receive messages for the Btinternet (xxx) account. Your server has unexpectedly terminated the connection. Possible causes for this include server problems, network problems or a long period of inactivity.
    Server: 'mail.btinternet.com'
    Windows Live Mail Error ID: 0x800CCC0F
    Protocol: POP3
    Port: 110
    Secure(SSL): No
    The messages for this account are available via webmail, and sending an email works. 
    I've tried BT Desktop Help, but this simply sends me in the direction of standard advice pages. I have no reason to think the settings are wrong. 
    Could anyone suggest what is going on here please?

    LesHarg wrote:
    Hello
    I use Windows Live Mail to download my emails. This is working fine on two computers for other BT Internet and Gmail accounts. But one of my main BT accounts consistently receives the following messages on both computers:
    Unable to send or receive messages for the Btinternet (xxx) account. 
    Server Error: 0x800CCC90
    Server Response: -ERR inactivity timeout
    Server: 'mail.btinternet.com'
    Windows Live Mail Error ID: 0x800420CD
    Protocol: POP3
    Port: 110
    Secure(SSL): No
    Unable to send or receive messages for the Btinternet (xxx) account. Your server has unexpectedly terminated the connection. Possible causes for this include server problems, network problems or a long period of inactivity.
    Server: 'mail.btinternet.com'
    Windows Live Mail Error ID: 0x800CCC0F
    Protocol: POP3
    Port: 110
    Secure(SSL): No
    The messages for this account are available via webmail, and sending an email works. 
    I've tried BT Desktop Help, but this simply sends me in the direction of standard advice pages. I have no reason to think the settings are wrong. 
    Could anyone suggest what is going on here please?
    Hi. Welcome to the forums.
    For starters, the recommendation by many people is to uninstall BT Desktop help.
    If this has always been the case, rather than a sporadic issue, then it could be an account problem that seems to plague some accounts - and has done for years. Hopefully the changeover from Yahoo! to Critical Path will cure this particular issue. Try the other settings mentioned by Keith.
    Even though some accounts are fine, there is still a possibility that your local security software can interfere. For example if you have email scanning turned on - then this can be turned off to see if that helps.
    http://www.andyweb.co.uk/shortcuts
    http://www.andyweb.co.uk/pictures

Maybe you are looking for