• 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

Can we attach multiple email addresses through spring email

 
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi sumant,

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

Herman
 
Simpson Kumar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 387
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic