bill.damage ha scritto:
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
You should look at javamail documentation for that.
One solution is to use:
-------
ByteArrayOutpuStream bos = new ByteArrayOutputStream();
Mail.getMessage().writeTo(bos);
-----
Then you can use a ByteArrayInputStream to read that data.
Please note that this method dump the whole message in memory, so make
sure you don't do this with big messages.
Stefano
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]