Answer the question
In order to leave comments, you need to log in
How can mail be sent to multiple persons in java spring?
I send a regular letter using the JavaMailSender and MimeMessageHelper classes, which actually has a setTo(String) method, and now if there is such a situation: you need to send the same letter to several people, it’s not in a cycle, yes (depending on how many recipients there are so many and send iterations)? How would it be better to implement
Answer the question
In order to leave comments, you need to log in
MimeMessageHelper.setTo(String[])
MimeMessageHelper.addTo()
True then ALL recipients of the message will see the addresses of ALL recipients. To avoid this, use the "Bcc" field - it is not sent. And in the "To" field, substitute the "left" address (the address of the mailing list, if any).
If this is not suitable, then send only in a cycle
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question