| Author |
Sending Multiple Emails
|
Crystal Bazil
Ranch Hand
Joined: Sep 28, 2004
Posts: 38
|
|
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
|
 |
Brendan Caden
Greenhorn
Joined: Jan 09, 2006
Posts: 5
|
|
Is this because your, ArrayList owners = notifierInformation.getSitemgrList(); is not actually an array? I think it needs [].
|
 |
Chengwei Lee
Ranch Hand
Joined: Apr 02, 2004
Posts: 884
|
|
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 [].
|
SCJP 1.4 * SCWCD 1.4 * SCBCD 1.3 * SCJA 1.0 * TOGAF 8
|
 |
Chengwei Lee
Ranch Hand
Joined: Apr 02, 2004
Posts: 884
|
|
Hi Crystal, I suspect it is the return; thats causing you the problem. Do check it out.
|
 |
Crystal Bazil
Ranch Hand
Joined: Sep 28, 2004
Posts: 38
|
|
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 ]
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16480
|
|
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
Joined: Sep 28, 2004
Posts: 38
|
|
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 ]
|
 |
 |
|
|
subject: Sending Multiple Emails
|
|
|