Skip to content

Generating an EML from an Email object with nested attachments, when created from an Outlook MSG file #315

@atmcq

Description

@atmcq

Following #298 I can access nested Outlook attachments within Email objects that have been created by EmailConverter.outlookMsgToEmail().

However if I subsequently use EmailConverter.emailToEML() on the Email object created in this way, the nested Outlook attachment is replaced with the serialised object as an SJM file, e.g. "attachment 1 as nested Outlook message (converted).sjm".

It looks like it needs to be deserialised and converted back to a .MSG or .EML attachment as part of emailToEML().

public static void main(String[] args) throws IOException {
    viewMsg();	
}
	
public static void viewMsg() throws IOException {
    Email em1 = EmailConverter.outlookMsgToEmail(new File("Email2.msg"));
    String emlStr = EmailConverter.emailToEML(em1);
    FileOutputStream outputStream = new FileOutputStream("NewEml.eml");
    byte[] strToBytes = emlStr.getBytes();
    outputStream.write(strToBytes);
    outputStream.close();
}

Examples.zip

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions