Package javax.mail.internet

Examples of javax.mail.internet.MimeBodyPart.writeTo()


      sText = oOrMsg.tagBodyPlain();

    MimeBodyPart oText = new MimeBodyPart();
    oText.setContent(sText, "text/html");
    java.io.ByteArrayOutputStream oBaStrm = new java.io.ByteArrayOutputStream(sText.length()*2+2);
    oText.writeTo(oBaStrm);

    oStmt = oConn.prepareStatement("UPDATE "+DB.k_mime_msgs+" SET "+DB.len_mimemsg+"=?"+","+DB.tx_subject+"=?,"+DB.by_content+"=? WHERE "+DB.gu_mimemsg+"=?");
    oStmt.setInt(1, oBaStrm.size());
    oStmt.setString(2, oOrMsg.getSubject());
    oStmt.setBinaryStream(3, new java.io.ByteArrayInputStream(oBaStrm.toByteArray()), oBaStrm.size());
View Full Code Here


      sText = oOrMsg.tagBodyPlain();

    MimeBodyPart oText = new MimeBodyPart();
    oText.setContent(sText, "text/html");
    java.io.ByteArrayOutputStream oBaStrm = new java.io.ByteArrayOutputStream(sText.length()*2+2);
    oText.writeTo(oBaStrm);

    java.math.BigDecimal oPosition;
    oStmt = oConn.prepareStatement("SELECT "+DB.nu_position+" FROM "+DB.k_mime_msgs+" WHERE "+DB.gu_mimemsg+"=?");
    oStmt.setString(1, sGuOriginalMsg);
    oRSet = oStmt.executeQuery();
View Full Code Here

    if (sContentType.toLowerCase().startsWith("text/"))
      oBody.setContent(sBody, sContentType);
    else
      oBody.setContent(sBody, "text/"+sContentType);
    ByteArrayOutputStream oBodyStrm = new ByteArrayOutputStream((sBody.length()*2)+2);
    oBody.writeTo(oBodyStrm);
    oStmt.setInt(6, oBodyStrm.size());
    oStmt.setBytes(7, oBodyStrm.toByteArray());   
    oStmt.setString(8, sGuMsg);
    if (DebugFile.trace) DebugFile.writeln("PreparedStatement.executeUpdate()")
    oStmt.executeUpdate();
View Full Code Here

        }
        out.write(DASH_DASH);
        out.write(boundary);
        out.write(CR_LF);
        try {
            mimeBodyPart.writeTo(out);
        } catch (MessagingException ex) {
            IOException ex2 = new IOException("Unable to write the MimeBodyPart object");
            ex2.initCause(ex);
            throw ex2;
        }
View Full Code Here

        }
        out.write(DASH_DASH);
        out.write(boundary);
        out.write(CR_LF);
        try {
            mimeBodyPart.writeTo(out);
        } catch (MessagingException ex) {
            IOException ex2 = new IOException("Unable to write the MimeBodyPart object");
            ex2.initCause(ex);
            throw ex2;
        }
View Full Code Here

        }
        out.write(DASH_DASH);
        out.write(boundary);
        out.write(CR_LF);
        try {
            mimeBodyPart.writeTo(out);
        } catch (MessagingException ex) {
            IOException ex2 = new IOException("Unable to write the MimeBodyPart object");
            ex2.initCause(ex);
            throw ex2;
        }
View Full Code Here

         MimeBodyPart _msg = createBodyPart(providers, out);

         baos = new ByteArrayOutputStream();
         encrypted = generator.open(baos, encryptor);

         _msg.writeTo(encrypted);
         encrypted.close();
         byte[] bytes = baos.toByteArray();
         String str = Base64.encodeBytes(bytes, Base64.DO_BREAK_LINES);
         os.write(str.getBytes());
      }
View Full Code Here

      MimeBodyPart _msg = new MimeBodyPart(ih, "<customer name=\"bill\"/>".getBytes());

      ByteArrayOutputStream os = new ByteArrayOutputStream();
      OutputStream encrypted = generator.open(os, encryptor);

      _msg.writeTo(encrypted);
      encrypted.close();

      String str = Base64.encodeBytes(os.toByteArray(), Base64.DO_BREAK_LINES);

      ih = new InternetHeaders();
View Full Code Here

            outputBodyPart(out, mp);
            return;
        }

        mimePart.writeTo(out);
    }

    /**
     * internal preamble is generally included in signatures, while this is technically wrong,
     * if we find internal preamble we include it by default.
View Full Code Here

            /*
             * Create a new MimeMessage that contains the encrypted and signed
             * content
             */
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            encryptedPart.writeTo(out);

            MimeMessage encryptedMessage = new MimeMessage(session,
                    new ByteArrayInputStream(out.toByteArray()));

            /* Set all original MIME headers in the encrypted message */
 
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.