for(JsonObject json : emails) {
MimeEmail email;
try {
email = emailFactory.createMimeEmail(json);
if(email != null) {
email.send();
successful.add(json);
} else {
error.add(createErrorResponse(json, "Email could not be created from JSON."));
}
} catch (MimeEmailException e) {