Hi all,
Can anybody help me out with this error:
javax.mail.MessagingException: IOException while sending message;
nested exception is:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME ty
pe multipart/mixed; boundary="----=_Part_1_6083406.1202809384760"
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:356)
at javax.mail.Transport.send0(Unknown Source)
at javax.mail.Transport.send(Unknown Source)
at com.documentum.custom.contentscrapper.UWSUrlScrapper.sendMail(UWSUrlS
crapper.java:294)
at com.documentum.custom.contentscrapper.UWSUrlScrapper.getContent(UWSUr
lScrapper.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
and my mail sending code is:
String toAddressArray [] = toAddr.split(";");
int addressListLength;
Properties prop = new Properties();
prop.put("mail.smtp.host", smtpUrl);
Session sess = Session.getDefaultInstance(prop, null);
try
{
MimeMessage message = new MimeMessage(sess);
message.setFrom(new InternetAddress(fromAddr));
addressListLength = toAddressArray.length;
for(int index=0;index<addressListLength;index++) {
message.addRecipient(javax.mail.Message.RecipientType.TO, new InternetAddress(toAddressArray[index]));
}
message.setHeader("X-Mailer", "HISOMAILER");
message.setSentDate(new Date());
message.setSubject(strSubject);
MimeBodyPart mbp = new MimeBodyPart();
mbp.setContent(strMsg,"text/html");
Multipart mp = new MimeMultipart();
mp.addBodyPart(mbp);
message.setContent(mp);
message.saveChanges();
Transport.send(message);
} catch(AddressException e) {
e.printStackTrace();
} catch(MessagingException e) {
e.printStackTrace();
}
Thanks in advance,
Abdel Olakara
http://technopaper.blogspot.com