class ConfirmationServiceImpl extends CoreBaseService<ConfirmationServiceMetric<ConfirmationServiceContext>, ConfirmationServiceContext> implements
        ConfirmationService {

    @Override
    @Retryable
    public boolean sendMessage(MailMessage message) throws InvalidAddressException {
        boolean delivered = false;
        // send cc only once
        if (message.hasCC() && !message.getToEmailAddresses().contains(message.getCCEmailAddress())) {
            delivered = sendToOneRecipient(message, message.getCCEmailAddress());
        }
        // send messages without cc
        message.setNoCC();
        List<String> toEmailAddresses = message.getToEmailAddresses();
        for (String toEmailAddress : toEmailAddresses) {
            delivered = sendToOneRecipient(message, toEmailAddress);
        }

        return delivered;
    }

}