![]() ![]() sets the multipart as message's content code to add attachment.will be revealed later MimeBodyPart attachPart = new MimeBodyPart() MimeBodyPart messageBodyPart = new MimeBodyPart() Multipart multipart = new MimeMultipart() The Multipart object holds multiple parts in which each part is represented as a type of BodyPart whose subclass, MimeBodyPart – can take a file as its content.The steps to create a multipart message with multiple parts are as follows: Message message = new MimeMessage(session) ![]() The body must be of type Multipart for containing attachments. ![]() To understand how attachments are stored inside an e-mail message, let’s take a look at the following picture: As we can see, a message comprises of a header and a body. This article provides a step-by-step guide on how to add attachments to an e-mail message to be sent via a SMTP server, using the JavaMail API. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |