bill.damage schrieb:


Am Dienstag, den 12.08.2008, 07:00 -0700 schrieb bill.damage:

Stefano Bagnara-2 wrote:
bill.damage ha scritto:
Hi,

Hey sincere thanks for all the help but I'm still not there. I hope I
implemented your code correctly, but here rawEmail always comes out as "":

        public void service(Mail mail) throws MessagingException {

                logger.info("Entering Mailet service method");
                MimeMessage message = mail.getMessage();
            String rawEmail = "";
StringBuffer sb = new StringBuffer();
            try {
                BufferedReader msgStream = new BufferedReader(
                    new InputStreamReader(message.getInputStream()));
                String line = null;

                while ((line = msgStream.readLine()) != null) {
                    sb.append(line);
                }
            } catch (Exception e) {
                logger.log(Level.SEVERE, e.getMessage(), e);
            }

rawEmail = sb.toString(); ...


You can use the writeTo function from MimeMessage as mentioned before and described here: http://java.sun.com/products/javamail/javadocs/javax/mail/internet/MimeMessage.html#writeTo(java.io.OutputStream)

Its a lot easier :-)

Regards,
Sascha F.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to