Reading mails sent from GMail

前端 未结 2 1897
盖世英雄少女心
盖世英雄少女心 2020-12-21 15:59

I am using JavaMail to read mail in my Android app. I have tried to cover all combinations i.e Mail sent/received on/from Custom Server/Gmail ID/Live ID.

The problem

相关标签:
2条回答
  • 2020-12-21 16:45

    BodyPart 1 returns the content as javax.mail.internet.MimeMultipart@44f2e698

    Try calling getBodyPart on the MimeMultiPart

    That probably returns a MimeBodyPart you can call getContent() on http://docs.oracle.com/javaee/5/api/javax/mail/internet/MimeBodyPart.html#content

    0 讨论(0)
  • 2020-12-21 17:00

    You're probably only handling the simplest case of a text message with attachments. MIME allows much more. You need to learn about the difference between multipart/mixed, multipart/alternative, multipart/related, and multipart/signed. The JavaMail FAQ has more information on handling attachments and the msgshow.java demo program included with the JavaMail download bundle shows how to process messages with nested multiparts.

    0 讨论(0)
提交回复
热议问题