• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

How to send mail to more than one recipients

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

how to send mail to more than one receipients??
I am giving my code,



This code works fine for only single mail receipient......how to send mail to more than one receipients?? What changes i nedd to do in sendMail() method?
please help....its urgent..........
 
Sheriff
Posts: 22841
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're already calling "message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));". How about using that to add more recipients?
 
pallavi chaudhari
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Prime wrote:You're already calling "message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));". How about using that to add more recipients?



so,by using addRecipients() method how can i do? please tell
 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use message.setRecipients(Message.RecipientType.TO, addressTo); where addressTo is array of type InternetAddress.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

pallavi chaudhari wrote:so,by using addRecipients() method how can i do? please tell


The javadocs of the addRecipient and addRecipients methods are pretty clear on what they do, are they not?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic