Package javax.mail.internet

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


     * @throws MessagingException if an error occurs while writing the message
     */
    public void service(Mail mail) throws MessagingException {
        try {
            MimeMessage message = mail.getMessage();
            message.writeTo(System.err);
        } catch (IOException ioe) {
            log("error printing message", ioe);
        }
    }

View Full Code Here


                    super.write(b);
                }
            }
        };
        // Write
        mime.writeTo(os, headers);
    }

    public void writeSoapEnvelope(XMLStreamWriter writer) throws Exception {
        QName envelope = getEnvelopeName();
        String soapUri = envelope.getNamespaceURI();
View Full Code Here

        mmorig = null;
        System.gc();
        Thread.sleep(200);

        try {
            mm.writeTo(System.out);
        } catch (Exception e) {
            e.printStackTrace();
            fail("Exception while writing the message to output");
        }
       
View Full Code Here

        mm = null;
        System.gc();
        Thread.sleep(200);

        try {
            mm2.writeTo(System.out);
        } catch (Exception e) {
            e.printStackTrace();
            fail("Exception while writing the message to output");
        }
       
View Full Code Here

                return;
            }
           
            clearAllHeaders(message);
           
            message.writeTo(baos);
           
            BufferedReader br = new BufferedReader(new StringReader(baos.toString()));
               
            // this is synchronized to avoid concurrent update of the corpus
            synchronized(JDBCBayesianAnalyzer.DATABASE_LOCK) {
View Full Code Here

        mm = null;
        System.gc();
        Thread.sleep(200);

        try {
            mm2.writeTo(System.out);
        } catch (Exception e) {
            e.printStackTrace();
            fail("Exception while writing the message to output");
        }
       
View Full Code Here

            ByteArrayOutputStream baos = new ByteArrayOutputStream();
           
            double probability;
           
            if (message.getSize() < getMaxSize()) {
                message.writeTo(baos);
                probability = analyzer.computeSpamProbability(new BufferedReader(new StringReader(baos.toString())));
            } else {
                probability = 0.0;
            }
           
View Full Code Here

    mimeMessage.setFrom(addressFrom);
    mimeMessage.setContent(content, contentType);
    mimeMessage.setSubject(subject, charset);
    mimeMessage.setHeader("Content-Transfer-Encoding", contentTransferEncoding);
   
    mimeMessage.writeTo(os);
    byte[] byteArray = os.toByteArray();
    return byteArray;
  }
 
  //--------------------------------------------
View Full Code Here

            MimeMessage message = mail.getMessage();
            Headers headers = new MimeMessageHeaders(message);
            try {
              OutputStream os = new HeaderSkippingOutputStream(bhj.getOutputStream());
              if (forceCRLF) os = new CRLFOutputStream(os);
                message.writeTo(os);
                bhj.getOutputStream().close();
            } catch (IOException e) {
                throw new MessagingException("Exception calculating bodyhash: "
                        + e.getMessage(), e);
            }
View Full Code Here

     * @throws MessagingException if an error occurs while writing the message
     */
    public void service(Mail mail) throws MessagingException {
        try {
            MimeMessage message = mail.getMessage();
            message.writeTo(System.err);
        } catch (IOException ioe) {
            log("error printing message", ioe);
        }
    }

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.