Search code examples
jakarta-mail

How to set multiple return paths with java mail?


I need to set multiple return path emails. This is important in case of an undeliverable email . I need more than one person to be notified

This is how I set one

Properties props = System.getProperties();
props.put("mail.smtp.from", "bouncebackemail@example.com"); 

How to set multiple "bounce back emails" (or return paths) ?


Solution

  • There's no way to specify multiple return path addresses.

    You could set the return path to be an "alias" that forwards to multiple recipients.