File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes Sending Batch E-Mails Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Sending Batch E-Mails" Watch "Sending Batch E-Mails" New topic

Sending Batch E-Mails

Daniel Gee
Ranch Hand

Joined: Aug 29, 2003
Posts: 202
I have been using the standardized code (shown below) to send e-mails using the JavaMail API. The code works fine. Now, I have a number of e-mail recipients instead of only one. That is to say, I have a String Array and it is an Array of e-mail addresses. Consequently, I modified this line of code:


Do I have to make other modifications to this standardized code in order to send batch e-mails? I mean, does this standardized code also handle sending message to a number of different e-mail addresses?
JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
I have been trying the same thing too. I use the standardized JavaMail SendMail code in the Struts context.

However, sending bulk mails does not seem to work. I put the

in a loop.

Does anybody have an idea about what mistakes that I have made?

Here is my code:
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

However, sending bulk mails does not seem to work

Have you enabled SMTP debugging and checked what messages are being sent? Do you get an exception? Does JavaMail communicate with the server fine but you never see the messages? Have you created and registered Transport and Connection listeners to log whats going on? "does not seem to work" is not a popular phrase on this site with out a little more detail.

There is nothing in the JavaMail implementation to stop you bein able to do what you are trying (except manipulating the from address within a single session is frowned upon - though I've yet to find out why)

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
I agree. Here's the link:
subject: Sending Batch E-Mails
It's not a secret anymore!