if (o instanceof String) {
content = ((String)o).getBytes(Constants.UTF8_ENCODING);
} else if (o instanceof InputStream) {
InputStream is = (InputStream) o;
ByteArray ba = new ByteArray(p.getSize() > 0 ? p.getSize() : 1024, is);
content = ba.toByteArray();
} else {
content = (o.toString()).getBytes(Constants.UTF8_ENCODING);
}
if (p instanceof MimeBodyPart && Constants.EMAIL_TRANSFER_ENCODING.equals(((MimeBodyPart)p).getEncoding())) {