I need to add multiple CC addresses to my mail message, but I keep getting the following exception:
javax.mail.internet.AddressException: Illegal Address (email@email.com;email@email.com,15)
Here is my code:
final String ccAddress = (String) inputMessageHeaders.get(MailHeaders.CC);
final String[] arrayOfCCAddress = ccAddress.split(";");
for(String cc : arrayOfCCAddress) {
InternetAddress address = new InternetAddress(cc);
mimeMessageHelper.setCc(address);
}
The original value of ccAddress is "email@email.com;email@email.com" The actual addresses are valid. Why is it throwing an exception and adding the ",15" to the end of the CC address?
Thanks