hi, help me发送byte[]附件的问题

田春峰 2004-03-15 04:54:29
hi, help me发送byte[]附件的问题
the excpetion is :
------------------------------------------------------
javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: IOException while sending message;
nested exception is:
java.io.IOException: No content
at javax.mail.Transport.send0(Transport.java:219)
at javax.mail.Transport.send(Transport.java:81)
------------------------------------------------------

i retrive the attachment from the blob type filed in oracle db.
but when i send it , the above error occurs

below is my send code;

DataSource ds = new BufferedDataSource(b, filename);
bodyPart.setDataHandler( new DataHandler( new ByteArrayDataSource(b, "application/octet-stream",filename ) ) );
bodyPart.setFileName(filename);
multipart.addBodyPart(messageBodyPart);


-----------------------------------------------------
b is a byte array

any one can help me , thanks in advance
beijing,
china
...全文
13 点赞 收藏 回复
写回复
回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复

还没有回复,快来抢沙发~

相关推荐
发帖
Java EE
创建于2007-09-28

6.6w+

社区成员

J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
申请成为版主
帖子事件
创建了帖子
2004-03-15 04:54
社区公告
暂无公告