aspose file tools*
The moose likes Other Application Frameworks and the fly likes Can we attach multiple email addresses through spring email Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Can we attach multiple email addresses through spring email" Watch "Can we attach multiple email addresses through spring email" New topic
Author

Can we attach multiple email addresses through spring email

Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
we have an application that we need to send an email to multiple addresses from the to_address (splitting them with comma (,)), I can send single email, but i don't know how to send to multiple email addresses.

please give me simple suggestion


Thanks,
Kumar
Herman Schelti
Ranch Hand

Joined: Jul 17, 2006
Posts: 387
hi sumant,

why don't you post what you have so far?

Herman
Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
hi herman,

Earlier I used to send to single email address successfully by the following code in Struts Action and Spring's Email delegate.

in Struts Action, I used to get the to, from, subject and body and I sent to email delegate

Struts Action:


Email delegate:


in Application Context file:


please see the above code and give me a possible solution.

here what I'm thinking is, we can multiple email addresses by seperating with comma, and in Struts action we will split them to each email address and I will send to each one in a for loop. is that make sense? if any alternative please advice me
Herman Schelti
Ranch Hand

Joined: Jul 17, 2006
Posts: 387
hi,

look at Spring's javadoc:
SimpleMailMessage has 2 methods setTo. One that takes 1 String, and another that takes an array of Strings.

Hope this helps.

Herman
Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
hi Herman,
Excellent..! its working for multiple email to addresses.

I just took Stringtokenizer and i separated by comma and attached them to an array.

perfect..


thank you very much.. not even I checked documentation, its all my fault.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can we attach multiple email addresses through spring email