Setting the message attachments |
You can add one or more attachments to an email message by invoking the EmailMessage#addAttachment method and passing it an instance of com.jscape.inet.mime.Attachment. See the JavaDoc for other methods of adding attachments to an email message.
Example
// create new EmailMessage instance EmailMessage message = new EmailMessage();
// create new attachment containing file located at path Attachment a = new Attachment(new File("/usr/home/report.doc"));
// add attachment to message message.addAttachment(a); |