Is it possible to send messages if some of the addresses are invalid? By default, if any addresses are invalid the message isn't sent.

John Zukowski

You need to set the mail.smtp.sendpartial property to true:

props.put("mail.smtp.sendpartial", "true");
By default, this is false. The partial failure will trigger a SendFailedException.

This assumes the SMTP server is setup not to fail multiple recipient mail if any address is invalid.

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.