Can Java mail send mails to a file like mailq format locally
Hi,
WE designed an eBroadcast system where we can personlize emails, send emails and track the delivery status of each mail, but here my javamail program has to establish a connection with SMTP mail server and personalize email and send it to to server. It's a bit timely process
So I want it to be very fast. So I need Javamail send all mails to a plian text file excatly like mailq file. Then I will transfer that file to our mail server and have mail server process all the mails from mailq file
Can Java mail send mails to a file like mailq format locally
Thanks in advance
[609 byte] By [
satwika] at [2007-11-26 16:50:24]

# 1
JavaMail doesn't have any built-in support for that, but it has the
raw capabilities you would need to implement it yourself. In
particular, after composing a message, you can use the writeTo
method to write the message contents to a file. You may also
want to write a "control file" of your own design that contains
information like the recipients to send the message to. (You
can't get that information from the message itself if you use
Bcc recipients.)
But why don't you save yourself a lot of effort and just run an
SMTP server on the same machine as your JavaMail application?
The local communication should be very fast, and the local SMTP
server will handle all the queuing and retransmission necessary.