• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sending Batch E-Mails

 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
reply
    Bookmark Topic Watch Topic
  • New Topic