Properties props = new Properties();
Session session = Session.getDefaultInstance(props, null);
Message message = new MimeMessage(session,
request.getInputStream());
String subject = message.getSubject();
DataHandler dataHandler = message.getDataHandler();
DataSource dataSource = dataHandler.getDataSource();
MimeMultipart mimeMultipart = new MimeMultipart
(dataSource);
Part part1 = mimeMultipart.getBodyPart(0);
// get the content use common io, i use chinese, so i set
the encoding gb2313
String content = IOUtils.toString((InputStream)
part1.getContent(), "gb2312");
it is receiving mail demo, it works well
On Nov 8, 12:48 pm, m seleron <[email protected]> wrote:
> Hi
>
> GAE's getContent (or javamailAPI current version ?) is
> message.isMimeType ( "multipart / *") even when the
> ByteArrayInputStream so to return.
>
> When the isMimeType is multipart try to convert this source
>
> InputStream inputStream = (InputStream)mimeMessage.getContent();
> String ContentType = mimeMessage.getContentType();
> ByteArrayDataSource byteArrayDataSource = new ByteArrayDataSource
> (inputStream,ContentType);
> Multipart mimeMultipart = new MimeMultipart(byteArrayDataSource);
>
> Please try variously.
>
> thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en
-~----------~----~----~----~------~----~------~--~---