• Post Reply Bookmark Topic Watch Topic
  • New Topic

javamail

 
Luke Shannon
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I set an array of InternetAddresses as the recepient of my message:

msg.addRecipients(MimeMessage.RecipientType.TO, emails);

But than list list shows up in the To field of the email.

Is there anyway to set the recepients like this but have another value appear in the To field of the message?

Thanks,

L
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'd have to use a distribution list set up on your email server.
 
Luke Shannon
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I ended up creating a loop that sent each address in the list individually. This way each recipient's email only contains their own address and not the entire mail list in the �To� field of the message (my client did not want people to see the entire mail list). This solution makes the code a little more complex, but meets the requirements.

Thanks for replying.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!