Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MimeMultipart messageContent = new MimeMultipart();
- BodyPart bodyPart = new MimeBodyPart();
- DataSource source = new FileDataSource(yourFile);
- bodyPart.setDataHandler(new DataHandler(source);
- bodyPart.setFileName("MyFile.ext");
- bodyPart.setDisposition(Part.ATTACHMENT);
- // Then add to your message:
- messageContent.addBodyPart(bodyPart);
Add Comment
Please, Sign In to add comment