• 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 Multiple Emails

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Basically what I am doing with the below code is calling some methods and based on that criteria calling my notfierEmail servlet. NotifierEmail sends off an email notice.

Everything works in theory.. I get an email for the first element in my owner ArrayList with all proper information but then it just stops. No error message or anything.. I need to be able to loop through those owner elements and send off an email for each one.

Could someone point me in a direction on how to do this? I would really appreciate it. Thanks!

Crystal



 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is this because your,

ArrayList owners = notifierInformation.getSitemgrList();

is not actually an array? I think it needs [].
 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No Brendan, an ArrayList is not the same as arrays.

Is this because your,

ArrayList owners = notifierInformation.getSitemgrList();

is not actually an array? I think it needs [].

 
Chengwei Lee
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Crystal,

I suspect it is the return; thats causing you the problem. Do check it out.



 
Crystal Bazil
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Chengwei,

I thought this might be the case as well - However, in Tomcat 5.x it seems I have to put the return in otherwise I get a java.lang.IllegalStateException.

This is information I got here: java.lang.IllegalStateException

I have tried moving the return around to no avail..
[ May 24, 2006: Message edited by: Crystal Bazil ]
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem is that you are trying to send your e-mails by repeatedly forwarding to a servlet. This won't work because you can only forward the request once. My solution would be to change your design so that you don't use a servlet to send the e-mail, but a plain old Java class that you can use repeatedly.

But I told you all this at least a week ago on the Sun forum.
 
Crystal Bazil
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ETA - I think it just clicked what you meant - Please ignore. I might be back with questions. Thanks

[ May 24, 2006: Message edited by: Crystal Bazil ]


ETA: It is working perfectly now! Thanks All
[ May 24, 2006: Message edited by: Crystal Bazil ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic