How to Load MailMessage from MIME string in Java

I see for .net you can use the following:

MailMessage msg = MailMessage.Load(new MemoryStream(Encoding.UTF8.GetBytes(msgString)), MessageFormat.Eml);

what about java? The content string is multipart/mixed which means it contains attachment as well.

Hi,


Thank you for writing to Aspose Support team.

You can use the following code sample to achieve this:

String string = “abc\u5639\u563b”;
byte[] utf8Array = string.getBytes(“UTF-8”);
InputStream str = new ByteArrayInputStream(utf8Array);
MailMessage mail = MailMessage.load(str);

Please try it at your end and let us know your feedback.