* @param normalizedMessage the normalized message from JBI
* @throws javax.mail.MessagingException if the message could not be constructed or there was an error creating an address
*/
public void prepareMessage(MimeMessage mimeMessage, MessageExchange exchange, NormalizedMessage normalizedMessage) throws javax.mail.MessagingException {
try {
Address to = getTo(exchange, normalizedMessage);
if (to != null) {
mimeMessage.setRecipient(Message.RecipientType.TO, to);
}
Address cc = getCc(exchange, normalizedMessage);
if (cc != null) {
mimeMessage.setRecipient(Message.RecipientType.CC, cc);
}
Address bcc = getBcc(exchange, normalizedMessage);
if (bcc != null) {
mimeMessage.setRecipient(Message.RecipientType.BCC, bcc);
}
Address from = getFrom(exchange, normalizedMessage);
if (from != null) {
mimeMessage.setFrom(from);
}
String text = getText(exchange, normalizedMessage);
String html = getHtml(exchange, normalizedMessage);