Apex Email Error - INVALID_EMAIL_ADDRESS, Invalid to address
Try validating cc and bcc addressess by checking null or empty
if(emailCCAddress != null && emailCCAddress.trim() != ''){
Ccaddress = emailCCAddress.split(',',0);
mail.setCcAddresses(ccaddress);
}
if(emailBCCAddress != null && emailBCCAddress.trim() != ''){
Bccaddress = emailBCCAddress.split(',',0);
mail.setBccAddresses(Bccaddress);
}