Package javax.mail.internet

Examples of javax.mail.internet.MimeMultipart.addBodyPart()


            if (contentType.startsWith("text/")){
                alternativeBodypart.setContent( this.alternativeBody,this.alternativeContentType + ";charset= " + this.alternativeCharset);
            }else{
                alternativeBodypart.setContent( this.alternativeBody,this.alternativeContentType);
            }          
            multipart.addBodyPart(alternativeBodypart);
           }
          

          
           message.setContent(multipart);
View Full Code Here


      
        BodyPart messageBodyPart = new MimeBodyPart();
        messageBodyPart.setText(forwardSubject);

        Multipart multipart = new MimeMultipart();
        multipart.addBodyPart(messageBodyPart);

        messageBodyPart = new MimeBodyPart();
        messageBodyPart.setDataHandler(message.getDataHandler());

        multipart.addBodyPart(messageBodyPart);
View Full Code Here

        multipart.addBodyPart(messageBodyPart);

        messageBodyPart = new MimeBodyPart();
        messageBodyPart.setDataHandler(message.getDataHandler());

        multipart.addBodyPart(messageBodyPart);

        forward.setContent(multipart);

        Transport.send(forward);
       
View Full Code Here

    Multipart multipart = new MimeMultipart();
   
    BodyPart iCalAttachment = new MimeBodyPart();
    iCalAttachment.setDataHandler(new DataHandler(new javax.mail.util.ByteArrayDataSource(new ByteArrayInputStream(iCalMimeBody), "text/calendar;method=REQUEST;charset=\"UTF-8\"")));

    multipart.addBodyPart(iCalAttachment);
    multipart.addBodyPart(msg);
   
    mimeMessage.setContent(multipart);
   
    // -- Set some other header information --
View Full Code Here

   
    BodyPart iCalAttachment = new MimeBodyPart();
    iCalAttachment.setDataHandler(new DataHandler(new javax.mail.util.ByteArrayDataSource(new ByteArrayInputStream(iCalMimeBody), "text/calendar;method=REQUEST;charset=\"UTF-8\"")));

    multipart.addBodyPart(iCalAttachment);
    multipart.addBodyPart(msg);
   
    mimeMessage.setContent(multipart);
   
    // -- Set some other header information --
    //mimeMessage.setHeader("X-Mailer", "XML-Mail");
View Full Code Here

            msg.setSubType("alternative");
            main.setContent(msg);

            msgText = new MimeBodyPart();
            msgHtml = new MimeBodyPart();
            msg.addBodyPart(msgText);
            msg.addBodyPart(msgHtml);

        }
        else if (StringUtils.isNotEmpty(text))
        {
View Full Code Here

            main.setContent(msg);

            msgText = new MimeBodyPart();
            msgHtml = new MimeBodyPart();
            msg.addBodyPart(msgText);
            msg.addBodyPart(msgHtml);

        }
        else if (StringUtils.isNotEmpty(text))
        {
            // just text so the text part is the main part
View Full Code Here

        MimeMultipart mmpt = new MimeMultipart();
        MimeBodyPart b1 = new MimeBodyPart();
        b1.setContent("body 1", "text/plain");

        mmpt.addBodyPart(b1);

        b1 = new MimeBodyPart();
        b1.setContent("body2", "text/plain");
        mmpt.addBodyPart(b1);
View Full Code Here

        mmpt.addBodyPart(b1);

        b1 = new MimeBodyPart();
        b1.setContent("body2", "text/plain");
        mmpt.addBodyPart(b1);

        Address[] list = new Address[1];
        list[0] new InternetAddress("geirm@optonline.net");
//        list[1] =  new InternetAddress("jeremy@boynes.com");
View Full Code Here

        }

        if (EmailUtils.isNotEmpty(this.html))
        {
            msgHtml = new MimeBodyPart();
            bodyContainer.addBodyPart(msgHtml, 0);

            // apply default charset if one has been set
            if (EmailUtils.isNotEmpty(this.charset))
            {
                msgHtml.setContent(
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.