A
Alberto Dell'Era
Alternative subject: inverse of Message.writeTo() ;-)
To send a MimeMessage in JavaMail, one simply uses
Transport.send (message);
I need to store the mail on the file system (in a database actually,
but that's not the problem, I know how to do that) and then, later,
read it back and send it.
Serializing "message" is not possible since my message is not
serializable.
My idea is to store the message this way:
FileOutputStream fos = new FileOutputStream ("mymail.raw");
message.writeTo (fos);
fos.close();
and later (in another JVM) do something like this:
FileInputStream fis = new FileInputStream ("mymail.raw");
message.READFROM (fis);
Transport.send (message);
Sadly READFROM does not actually exist ... may any good soul suggest
an implementation for it, or another way to accomplish the same goal ?
BTW The message is a multi-part one, containing attachments such as
PDFs.
Many thanks, at least for reading up to this point!
Alberto
To send a MimeMessage in JavaMail, one simply uses
Transport.send (message);
I need to store the mail on the file system (in a database actually,
but that's not the problem, I know how to do that) and then, later,
read it back and send it.
Serializing "message" is not possible since my message is not
serializable.
My idea is to store the message this way:
FileOutputStream fos = new FileOutputStream ("mymail.raw");
message.writeTo (fos);
fos.close();
and later (in another JVM) do something like this:
FileInputStream fis = new FileInputStream ("mymail.raw");
message.READFROM (fis);
Transport.send (message);
Sadly READFROM does not actually exist ... may any good soul suggest
an implementation for it, or another way to accomplish the same goal ?
BTW The message is a multi-part one, containing attachments such as
PDFs.
Many thanks, at least for reading up to this point!
Alberto