// set the message content: multipart message + attachment
if ( pBodyEncoding == null || pBodyEncoding.trim().length() == 0 ) {
pBodyEncoding = "text/plain";
}
ContentPart[] content = { new ContentPart(pMsg, pBodyEncoding) };
MimeMessageUtils.setContent(msg, content);
// create the email event
EmailEvent em = new EmailEvent(msg);