絕對(duì)同意你的看法,,就好象我剛剛學(xué)習(xí)struts的時(shí)象,想找本中文的書看看,,難難難,,,中文資料都難找,可我的是英文極道有限公司呢。。。。現(xiàn)在的JAVA書的確翻譯得不怎么樣,,我看過最好的一本是with out ejb,其它的都一般般,特別是什么冶X出版社的,我發(fā)誓不買他的書的了。
messageBodyPart = new MimeBodyPart();
DataSource source = new ByteArrayDataSource(bytes[],contentType);
// Set the data handler to the attachment
messageBodyPart.setDataHandler(new DataHandler(source));
// Set the filename
BASE64Encoder enc = new BASE64Encoder();
String fileName="哈哈哈.txt";
//文件名用base64一下,解決中文問題
messageBodyPart.setFileName("=?utf-8?B?"+ enc.encode(fileName.getBytes("utf-8")) + "?=");
//protected Multipart multipart = new MimeMultipart("related");
multipart.addBodyPart(messageBodyPart);
//最后用mailMessage.setContent(multipart);
//這樣就OK了,寫得亂了一點(diǎn),,Momail就是用javamail來實(shí)現(xiàn)的了,有興趣的可以到momail.moabc.com去看看