"Subject: Unique Subject " + randomFactor);
rfcText = rfcText.replace("Message-ID: <", "Message-ID: <" + randomFactor);
Rfc822Msg rfcMsg = new Rfc822Msg(rfcText);
// create MailItemEntry with appropriate data
MailItemEntry mailItem = new MailItemEntry();
mailItem.setRfc822Msg(rfcMsg);
for (String label : labels) {
mailItem.addLabel(new Label(label));
}
for (MailItemProperty property : properties) {
mailItem.addMailProperty(property);
}
return mailItem;
}