Unable to read email content of type multipart/mixed....

Hi i have written following code to read text content form the multipart email content type,
but when i say
if (content instanceof Multipart){
System.out.println("############ Content Type is Multipart ############ ");
messagePart = ((Multipart) content).getBodyPart(0);
}the flow is not going into the if condition,
bellow is the detailed code and the output in the console, you can check with the SOPs
Part messagePart = message;
content = messagePart.getContent();
System.out.println("############ : " + content);
System.out.println("############ START MESSAGE BODY ############");
System.out.println(content);
System.out.println("############ END MESSAGE BODY ############");
if (content instanceof Multipart){
     System.out.println("############ Content Type is Multipart ############ ");
     messagePart = ((Multipart) content).getBodyPart(0);
String contentType = messagePart.getContentType();
System.out.println("############ CONTENT TYPE     : " + contentType);
System.out.println("############ CONTENT TYPE     : " + contentType);
if (contentType.startsWith("text/plain")) {
     System.out.println("############ Content Type is text/plain ############");
     InputStream is = messagePart.getInputStream();
     BufferedReader reader = new BufferedReader(new InputStreamReader(is));
     String thisLine = reader.readLine();
     while (thisLine != null) {
          actualMsg = actualMsg + thisLine + ".";
          thisLine = reader.readLine();
System.out.println("############ SMS CONTENT      :" + actualMsg);
System.out.println("/**********************Passing to E2SConverter********************/");
And the output for the same
Stack Trace*** Check for new mails on Mail Server for Processing ***
########## Unread Msg Count      : 1
########## FROM           : [email protected]
########## SUBJECT           : RE: SMS-5000-9969413222-S1221654991804 [T20080917000CS010Z246]
**************** Checking Subject Line ****************
******* GO AHEAD IS TRUE : EMAIL TO SMS CONVERTER *******
############ : javax.mail.internet.MimeMultipart@1a2760f
############ START MESSAGE BODY ############
javax.mail.internet.MimeMultipart@1a2760f
############ END MESSAGE BODY ############
############ CONTENT TYPE     : multipart/mixed; boundary=22902610.1221655198503.JavaMail.javamailuser.localhost
############ SMS CONTENT      :
/**********************Passing to E2SConverter********************/
Please help me for the same.. its bit urgent...
Thanks And Regards,
Amie...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Yes,
It's going into the if if block, but its giving me ClassCastException
System.out.println("******* GO AHEAD IS TRUE : EMAIL TO SMS CONVERTER ******* ");
Part messagePart = message;
content = messagePart.getContent();
System.out.println("############ : " + content);
System.out.println("############ START MESSAGE BODY ############");
System.out.println(content);
System.out.println("############ END MESSAGE BODY ############");
if (messagePart.isMimeType("multipart/*")) {
               System.out.println("############ Content Type is Multipart ############ ");
               messagePart = ((Multipart) content).getBodyPart(0); //GIVES EXCEPTION : ClassCastException at this line...
String contentType = messagePart.getContentType();
System.out.println("############ CONTENT TYPE     : " + contentType);
See the Stack Trace..TAconnVect.size()25
*** Check for new mails on Mail Server for Processing ***
########## Unread Msg Count      : 2
########## FROM           : [email protected]
########## SUBJECT           : SMS-5000-9969413222-S1221713640885 [T200809180003S070]
########## FROM           : [email protected]
########## SUBJECT           : SMS-5000-9969413222-S1221713740897 [T200809180004S070]
**************** Checking Subject Line ****************
******* GO AHEAD IS TRUE : EMAIL TO SMS CONVERTER *******
############ : javax.mail.internet.MimeMultipart@1f7be7b
############ START MESSAGE BODY ############
javax.mail.internet.MimeMultipart@1f7be7b
############ END MESSAGE BODY ############
############ Content Type is Multipart ############
java.lang.ClassCastException: javax.mail.internet.MimeMultipart
     at com.interactcrm.SMSConverterClass.PollEmail.CheckEmails(PollEmail.java:327)
     at com.interactcrm.SMSConverterClass.PollEmail.run(PollEmail.java:98)
     at java.util.TimerThread.mainLoop(Unknown Source)
     at java.util.TimerThread.run(Unknown Source)
- INFO : readMessage Checking for new messages in inbound table of ta database
TAconnVect.size()25
TAconnVect.size()25
and Bellow is the internet header of the mail which i am trying to read.Received: from grameenphone.com ([10.10.29.153]) by neptune.grameenphone.com with Microsoft SMTPSVC(6.0.3790.3959);
     Thu, 18 Sep 2008 10:55:52 +0600
Date: Thu, 18 Sep 2008 04:55:52 GMT
From: [email protected]
Subject: =?us-ascii?B?U01TLTUwMDAtOTk2OTQxMzIyMi1TMTIyMTcxMzc0MDg5NyBbVDIwMDgwOTE4MDAwNFMwNzBd?=
To: [email protected]
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="20238918.1221131600666.JavaMail.SYSTEM.ipcc-test3"
Return-Path: [email protected]
Message-ID: <[email protected]>
X-OriginalArrivalTime: 18 Sep 2008 04:55:52.0114 (UTC) FILETIME=[D35D2120:01C9194A]
Edited by: Amie on Sep 18, 2008 10:29 AM
Edited by: Amie on Sep 18, 2008 10:36 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Can't read Messages with Content-Type multipart/mixed

    For many years I have used „QuickMail Pro“, as my favorite Mail-Client. Now I had switch to Apple Mail. I hoped, to be more compatible to other „modern“ Mail-Clients. So could it be, that Apple Mail can not read Messages from Type <multipart/mixed>? I only see the Header-Information and instead of the Message-Text there is only an Error-Message:
    <Diese E-Mail kann aufgrund ihrer Formatierung nicht angezeigt werden. Bitten Sie den Absender, Ihnen die E-Mail erneut in einem anderen Format bzw. mit einem anderen E-Mail-Programm zu senden.
    multipart/mixed>
    Did anyone know a simple Way, to read this Messages.
    My old QuickMail has no Problem with this Type.

    Hi Ruchi,
    You need to use Java Mapping or UDF to create Multipart/Mime
    Check this excellent blog by stefan.
    http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/6321
    Also check this thread for your solution
    http://forums.sdn.sap.com/message.jspa?tstart=0&messageID=945095

  • E-Mail recevier with Content-Type: multipart/mixed

    Hi All,
    I am working on proxy to Mail scenario, wherein Pi is receiving data from SAP over proxy, creating a csv of the data and sending it to recipient as the email with the attachment.
    The User is saying that he wants the email content type as Multipart MIME format. I have searched on SDN and web, but couldnu2019t find how to implement in PI.Please provide your inputs.
    Thanks in advance,
    Ruchi

    Hi Ruchi,
    You need to use Java Mapping or UDF to create Multipart/Mime
    Check this excellent blog by stefan.
    http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/6321
    Also check this thread for your solution
    http://forums.sdn.sap.com/message.jspa?tstart=0&messageID=945095

  • Double gray bars you have to drag down in order to read email content

    Anyone ever see this? Sometimes when I open an email it looks like there is nothing in it.  At first, I'd just delete the email thinking the sender forgot to send something.  But then I discovered that those specific emails had a little double gray bar at the top.  I touched the bar and dragged it and it opened the "content" area of the email.  This doesn't happen often, so I can't place my finger on what TYPES of emails it may be happening in, like maybe forwarded ones, or ones that are too long? I don't know.  It's just kind of weird.  I googled it, but there is nothing.
    Has anyone ever experienced that?  An email where all you can see is the heading, and the signature, but the actual content is all squished together.  You then have to drag the double gray bar in order to see and read the content.
    Thanks

    Yes, you need to publish as public to test social sharing. If you don't want to publish folios as public because the app is already in the store, you might want to set up a different application account for testing purposes. You can share/copy the folios from one account to the other and publish as public. Create or edit an app that points to that account.

  • Reading email contents from a program

    Hello,
    I need to read an email content from a program, to attach it to an CRM activity. Does anybody know if there is a function for this? I will have the email data (Object id, folder, type, etc) available.
    Thank you!
    Paola

    Hi,
    My Requirement is :
    1)I got a requirement to read Bounce back mails in the CRM System .My present scenario is that once a campaign is executed , the mails which get bounce back are returned to outlook location.
    2)The required scenario demands that, to read email IDs which get Bounce back and need to be compared with Email Ids in the Target group , which is assigned to the campaign and update the 'COunter' field which is assigned to the E-mails in the Master Data.
    3)Is there any machanism to read the BOunce-Back mails in CRM System itself (or) It should be read from outlook location where the mails are returned presently, so that COUNTER which is tied up with the E-mails in Master Data can automatically updated.
    4) Is there any possibility to read the Mails in the Outlook location with Mail IDs in the CRM system.
    I have gone through Mr Thomas article and i think it works for my requirement  but i dont know how to proceed further to read bounce back mails when a campaign is executed in CRM System.
    Can any one guide  me how to solve this problem .
    THANKS
    SURESH

  • Unable to read email on iphone4

    For the past few days I have been unable to read my email messages on my iphone.
    New messages are displayed, along with the preview, but when I click on a message I am unable to read it on my phone.
    Does anyone know what this might be caused by?

    I have been having the same problem for the last two days. Co-worker of mine had the same problem and recommended deleting and re-registering accounts all over again. Unfortunately, it didnt help. Hopefully someone knows how to fix this.

  • TS3899 Unable to read emails on iPhone.

    I have internet access and everything works fine on my iPhone except that when I click on the mail icon, after a few seconds it turns blank and takes me back to the home page on my iPhone. I turned the power off twice and the problem continues and I am unable to read any of my emails on my iPhone.

    Hi cblira!
    Here is an article with some tips about troubleshooting the mail app:
    iOS: Troubleshooting Mail
    http://support.apple.com/kb/ts3899
    If the steps in that article do not resolve the issue, you may need to restore your device:
    Use iTunes to restore your iOS device to factory settings
    http://support.apple.com/kb/ht1414
    Take care, and thanks for visiting the Apple Support Communities.
    Cheers,
    Braden

  • Unable to read email

    I am unable to read most of my email especially my pictures, this is the ERROR: This item cannot be displayed in the reading pane.  The item has not been received from the server.
    After 2 or 3 minutes some will "unlock" so I can read it or some will just disappear or never open.
    Can anyone help me?  My job depends on my email.
    Thank you,
    [Edited for privacy-please do not post personal or unique information such as but not limited to full names, employee ID numbers, email addresses, phone numbers, account numbers, etc.]

    Hi pedrochin, email client: if I understand the question..AT&T thus: sbcglobal.net my email address device: my pc connected to: AT&T uverse did this answer your questions? Thank you for asking, I do hope you can help...sj

  • Adobe unable to read email attachment

    I want to know how to get adobe to read my email attachment.  Adobe reader says it is either not a supported file type, or that the file has been damaged.  What do I do?

    Hi Pat.  The one that is opening is an email opening in wordpad or docx.  The other three don't seem to open right away.  I have to go through adobe.  They are doc.  All four from a distance appear to be microsoft word documents.  I don't understand about the file association being correct or not.  They all look similar, but apparently one is different and opens while the other word documents do not.

  • Unable to print email content or from web but ok from windows viewer.

    I have been using my Deskjet F4272 for at least one year with Windows 7 Pro 64 bit operating system.
    Now I cannot print the contents of emails or web or scan anything. The only way I can print is to carry out a screen grab using the snipping tool  and open the item in Windows viewer and print from there with no problem.
    I have 3 Windows Pc's and the problem exists on all of them. They are running with latest updates.
    Recently I have bought AVG anti virus which is installed on these PC's. I have downloaded the HP diagnostics tool which tells me all is OK ! I have downloaded the full install software (210Meg) and this tells me all is running OK !!!
    Now I don't know how to proceed other than to chuck the printer away and go to another supplier !
    Any ideas anyone ?
    Regards. Chrisy

    I don't know if this will help you, but I have an hp deskjet 2512 and a dell computer.  I could always print emails and then today it would not print the content of the email, only the heading.  I have been searching on here for a solution, but have found nothing.  Just for the heck of it, I tried to print another email and after clicking on print I clicked on "pages" , where you can indicate what page you want printed and it worked!  It printed the entire email.  Go figure.

  • Unable to read email with mozilla firefox. The online graphics are missing and the links are unable to be accessed when I try to click on them

    Having issues with being able to assess my email on Mozilla Firefox. When I sign in, the graphics are missing. Once I'm logged in, the inbox is not there. Some thing is wrong graphically. There are work links for inbox and contacts, but they are all flushed to the left of the screen. When I attempt to click on them, nothing happens. I have tried to remove Firefox and then reinstall it but the same thing happens. I also attempted to reset firefox to its default state and that did not work either. I check plug ins and most are up to date. However, not clear for window presentation foundation is and if it was necessary to have. The plug in state was unknown. Please advise on what to do? Thanks!

    Make sure that you haven't enabled a High Contrast theme in the Windows/Mac Accessibility settings.
    Make sure that you allow pages to choose their own colors.
    *Tools > Options > Content : Fonts & Colors > Colors : [X] "Allow pages to choose their own colors, instead of my selections above"
    Note that these settings affect background images.
    See also:
    *http://kb.mozillazine.org/Website_colors_are_wrong
    You can try these steps in case of issues with web pages:
    You can reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Hold down the Shift key and left-click the Reload button
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Command + Shift + R" (Mac)
    Clear the cache and remove cookies only from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > "Use custom settings for history" > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Able to log into Hotmail but unable to read emails

    Hey all!
    So basically, what's happening is that I'm able to log into my hotmail account and see the inbox and all, but I can't click on my emails to read them. It's really frustrating cos I've tried using Firefox and another computer, but neither works! Please help me I'm kind of desperate!

    if you r desperate, get a gmail account and have it send and receive messages as your hotmail account. to anyone who you send an email to, it will seem like you are still using hotmail.

  • Recently I am unable to read emails in Hotmail. Why and can it be fixed?

    I have a laptop with windows vista. I can sign into hotmail, but I cannot open any emails. It will work in internet explorer, but not firefox.

    If your outgoing mail server was too slow in responding, then Mail may have deselected it assuming it was incorrect.  This happens sometimes with the servers if there is an issue at their end.

  • Unable to read emails on my mobile

    Hi all new on here, i have a question about the BT Yahoo app on my mobile phone.
    Since the update of  BT mail i have not been able to log onto the web site to view my emails on my phone, when i openthe app it asks for email address and password then it says that i need to update settings from a desktop at yahoo.com.
    I've looked on there but can't find what to update.
    Any ideas please.
    Samsung Galaxy S5, worked fine before changes to bt mail.
    Thanks Simon.
    Solved!
    Go to Solution.

    If you go to the "PlayStore" app on your phone and search for "Aquamail" app, download it and it will install. You then need to set it up.
    To set up the default email app see this link
     http://www.samsung.com/us/support/supportOwnersHowToGuidePopup.do?howto_guide_seq=7328&prd_ia_cd=N00...
    You will need to use the settings in this link
    http://bt.custhelp.com/app/answers/detail/a_id/44917/~/bt-email%3A-what-are-the-settings-for-outgoin...

  • N70 - unable to read message content past first sc...

    Unable to get past the main screen.
    After getting through to applicaitons part by pulling SD card out, saw that half the applicaitons are missiing ...
    Where have they gone and how can I restore them?
    Basic functionality of phone works - it rings and answers but thats it ...can't view contacts, messages...
    Help
    Simon

    i couldn't understand how the memory card is related to the problem but i think you shoud format your phone just to get everything in order.
    to format your phone :
    Method 1
    1) Switch off your phone
    2) Press and hold these 3 keys together:
    -green dial key
    -the star key(*)
    -the number 3 key
    3) Turn the phone on
    Do not release the keys until you see a formatting screen and even after the phone has started. Wait until the initial sound starts to play and the hand animation is displayed.
    Method 2
    on the screen type *#7370#
    you will be prompted for a Security Code. This is 12345 if you haven't changed it.
    Do ensure that you have backed up your data first onto a PC by using pc suite.
    in the case that this problem only appears only when the memory card is in place then instead of formatting the whole phone, i advice you to format the memory card only and try again..
    Fear not those who argue but those who dodge

Maybe you are looking for

  • HD file corrupt - how do I let Apple know?

    Game of Thrones Ep 1.1 - Winter is Coming HD file is corrupt and won't download.  I paid for the HD file and would like to get that, and I don't know how to let apple know about this problem.  I can't find any contact information.

  • CF10 Production Best Practices

    Is there a document or additional information on the best way to configure multiple instances of CF10 in a production environment? Do most folks install CF10 as a ear/war J2EE deployment under JBoss or Tomcat with Apache as the webserver?

  • UK user on BT Hub3-ipad wifi problem-Help!

    Since upgrading to OSX 10.8.1 I am unable to connect my ipad2 to wifi using BTHUB3 (UK user). Have tried all the obvious things but cannot get this to work. I am told this is a glitch on apple software and an upgrade is due Sept 2012. Any ideas? Thx

  • Independently configure date format for XML/JSON serialization

    How do I configure the date format independently for each of my date fields? For example, let's say I have a CustomerOrder class with more than 1 java.util.Date fields in it. I need to be able to render like this: <customerOrder> <orderDate>2013-01-0

  • Cannot use the command "warm-reload" on IOS 12.4T

    Hi, I would like to use the command "warm-reload" like the following documentations on the router 2611XM with IOS 12.4T. http://www.cisco.com/en/US/docs/ios/fundamentals/configuration/guide/warm_reload_ps6441_TSD_Products_Configuration_Guide_Chapter.