> Date: Tuesday, August 18, 2015 15:19:18 -0700 > From: [email protected] > > So I am creating a fork of K9 mail and I am trying to receive > email. The issue is that the sendMessage method is not being very > cooperative. Due to reasons that can't really be fixed I have to > convert the Body of the K9 message into a different Body from a > separate library. My best guess was to convert the body to > string, then from there convert the string back into the new body > since that is really all the two seem to share in common. However > this didn't work. This is what I got back > *com.fsck.k9.mail.internet.MimeMultipart@2f2666c4 > <com.fsck.k9.mail.internet.MimeMultipart@2f2666c4> *problem is > that this isn't remotely helpful. I get that means that the > message has a multipart body but the thing that is trouble is > trying to cast something like TextBody body = message.getbody(); > or whatever doesn't work. You can only get the abstract body and > not anything more useful. Is there anyway to remedy this? What > can I do to get the body of a message as text that is accurate to > the real text body. > > > PS, I know there is a K9 Dev group but no one really posts to that > anymore.
I think you may need to delve into the K9 source more deeply than I think you have to this point. Try looking at: <https://github.com/k9mail/k-9/blob/master/k9mail-library/src/main/ja va/com/fsck/k9/mail/internet/MessageExtractor.java> On a quick scan, that appears to be where the parts of the retrieved message are extracted. From that, I think you should be able to figure out how to get whatever [extracted] part(s) -- plain text, html, attachments, pgp-signatures -- you are after. Good luck. -- -- You received this message because you are subscribed to the K-9 Mail Users List. To post to this group, send email to [email protected] To unsubscribe, email [email protected] To report an issue with K-9 Mail, visit http://code.google.com/p/k9mail/issues/list For more options, visit this group at http://groups.google.com/group/k-9-mail --- You received this message because you are subscribed to the Google Groups "K-9 Mail" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
