Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending Batch E-Mails

 
Daniel Gee
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

to

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
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic