TextWatermarkwatermark=newTextWatermark("Test watermark",newFont("Arial",19));EmailLoadOptionsloadOptions=newEmailLoadOptions();// Specify an absolute or relative path to your document. Ex: "C:\\Docs\\message.msg"
Watermarkerwatermarker=newWatermarker("message.msg",loadOptions);EmailContentcontent=watermarker.getContent(EmailContent.class);for(EmailAttachmentattachment:content.getAttachments()){// Check if the attached file is supported by GroupDocs.Watermark
IDocumentInfoinfo=attachment.getDocumentInfo();if(info.getFileType()!=FileType.Unknown&&!info.isEncrypted()){// Load the attached document
WatermarkerattachedWatermarker=attachment.createWatermarker();// Add watermark
attachedWatermarker.add(watermark);// Save changes in the attached file
attachment.updateContent(attachedWatermarker);attachedWatermarker.close();}}// Save changes
watermarker.save("message.msg");watermarker.close();