How can I achieve following feature at Email2PDF?

I use Aspose Email Java to make Email2PDF, however now we have such a requirement:

If an Email contains inline attachment picture and another non-inline attachment picture, only inline picture should be converted into PDF, however the non-inline attachment picture should be excluded.

how can I achieve this feature?

Hello @zwei,

You can set MhtFormatOptions to exclude Outline Attachment:

MailMessage message = MailMessage.load(fileName);
MhtSaveOptions mhtSaveOptions = new MhtSaveOptions();
mhtSaveOptions.setMhtFormatOptions(mhtSaveOptions.getMhtFormatOptions() & ~MhtFormatOptions.WriteOutlineAttachments);
message.save(fileName+ ".mhtml", mhtSaveOptions);
1 Like