View RSS Feed

Recent Blogs Posts

  1. Email Multi-Part Messages

    by , 04-25-2012 at 10:33 PM
    Message could be sent with text, HTML message body or file attachment by using multi part messages. MimeMultipart object can be created to hold parts, then MimeBodyPart objects are created for every attachment/ message body and added to container. Lastly, container is assigned to MimeMessage content.

    Java Code:
    import javax.activation.DataHandler;
    import javax.mail.Multipart;
    import javax.mail.internet.MimeBodyPart;
    import javax.mail.internet.MimeMultipart;