Am Dienstag, den 12.08.2008, 07:00 -0700 schrieb bill.damage:
>
>
> Stefano Bagnara-2 wrote:
> >
> > bill.damage ha scritto:
> >> Hi,
> >>
> >> In a Mailets service method I see the param is a Mail instance. I need to
> >> get the full raw email from this, that is all the headers, subject, body
> >> etc
> >> actually as transmitted. How is this done please?
> >>
> >> Thanks.
> >
> > Mail.getMessage()
> >
> > Thanks - that returns a javax.mail.internet.MimeMessage - I can't quite
> > see how to get the String of the raw email from it?
> > Stefano
> >
> >
Something like this:
BufferedReader msgStream = new BufferedReader(new
InputStreamReader(MimeMessage.getInputStream());
String line = null;
StringBuffer sb = new StringBuffer();
while ((line = msgStream.readLine()) != null) {
sb.append(line);
}
System.out.println(sb.toString());
Cheers,
Norman
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]