SENDING BULK MAIL in JAVAMAIL
I'm trying to send 5000+ emails per session... Each email is personalized. what would be the best way to send each mail?
performance is somewhat critical...
currently, i create one session, then create Message for each email, stuff the variables, then send them one by one...
how about creating a stack of Message (with individual Sessions) and then send them one by one? is there a limit on how many Messages i can create on a single session?
thanks in advance...
dave..
[524 byte] By [
dknkgp] at [2007-9-26 1:43:05]

Creating one session as compared to two is quite a bit faster when dealing with 5000+emails. If you have each invidual session doesn't that mean you have to open close a Transport each time? If the way you have now works, why do you want to change it? As for a limit of how many Messages, there isn't one as long as your mail server doesn't mind you sending that many at one time. Anyone please feel free to correct me if I am wrong.
There should be one session only as opening and closing sessions for 5000 + mails makes no sense. The problem arises as sendMessage() takes around 4 secs (elapsed time) per mail, which is quite high. Is there any way to send different message objects using sendMessage() only once?
like sendMessage(MessageObject,AddressObject)