Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Sending Batch E-Mails

 
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?
 
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:
 
Bartender
Posts: 10336
Hibernate Eclipse IDE 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)
 
No one can make you feel inferior without your consent - Eleanor Roosevelt. tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic