if (email.getBcc() != null)
{
exchangeMessage.addNewBccRecipients().addNewMailbox().setEmailAddress(email.getBcc());
}
}
BodyType response = sendRequest(request);
ItemInfoResponseMessageType[] responses =
response.getCreateItemResponse().getResponseMessages().getCreateItemResponseMessageArray();
if (responses.length != emails.size())
{
LOG.debug(response.toString());
throw new FailedToCreateMessage(
"There should have been " + emails.size() + " response message to createItem");
}
for (ItemInfoResponseMessageType resp : responses)
{
if (resp.getResponseCode() != ResponseCodeType.NO_ERROR)
{
LOG.debug(response.toString());
throw new FailedToCreateMessage(
"ResponseCode some sort of error: " + resp.getResponseCode());
}
}
}