Independentsoft
Home
Products
Purchase
Support
Downloads
Company
Contact
JMSG
>
Tutorial
> Get attachments
The following example shows you how to get attachments and save them to file system.
import java.io.IOException; import com.independentsoft.msg.Attachment; import com.independentsoft.msg.Message; public class Example { public static void main(String[] args) { try { Message message = new Message("c:\\temp\\message.msg"); for (Attachment attachment : message.getAttachments()) { attachment.save("c:\\temp\\" + attachment.getFileName()); } } catch (IOException e) { e.printStackTrace(); } } }