忘了说: 那个o是message[i].getContent()对象
解决方案 »
- 关于JAVA与数据库的问题。求指点
- 新手问问题之代码错在哪里
- 请问如何在JTable中添加和修改一行数据??谢谢
- 公式解析器包
- Eclipse 如何使用阿?请那位大虾帮一下忙啊
- 请教一个RMI中对象参数传递的问题
- 求助!用eclipse编写JNI程序出现UnsatisfiledLinkError异常
- 有什么高效的办法获取URL的参数当成map
- 请教各位高手,棘手的日文字符转换1
- 请教一个jaxp的问题(概念澄清)
- 如何让IE认识applet所带的数字签名,而不是让证书仓库认识这个带数字签名的applet,就是说不装jdk也可以在IE里面使用带有签名的applet,详情请进
- 哪位网友可以详细讲一下“回调”呢?谢谢
<-
......
// Adding a subject to the mail
msg.setSubject(subject);
// Adding the X-mailer to the mail (the name of the Mailer)
msg.setHeader("X-Mailer", mailer); //TEXT
MimeBodyPart multitext = new MimeBodyPart(); // This will add the text to the mime body part
texto += "Text plain here";
multitext.setText(texto); // setting the right values for the Header
multitext.setHeader("Content-Type", "text/plain;
charset=\"iso-8859-1\"");
multitext.setHeader("Content-Transfer-Encoding", "8bit");
// This will return all the fields to be signed
ByteArrayOutputStream baos = new ByteArrayOutputStream();
multitext.writeTo(baos);
System.out.println("->>>>" + baos.toString()+"\n <------"); // HTml
MimeBodyPart multipartHTML = new MimeBodyPart();
//
multipartHTML.setText("<html>" + text + "</html>");
// setting the right values for the Header
multipartHTML.setHeader("Content-Type","text/html;");
multipartHTML.setHeader("Content-Transfer- Encoding", "base64");
multipartHTML.setHeader("charset","\"gb2312\""); //Creating a multipart that will englobe all the already defined bodyparts, this will also define the header of the message Multipart multipart = new MimeMultipart("alternative");
// Adding both, the text, and the signature
multipart.addBodyPart(multitext);
multipart.addBodyPart(multipartHTML);
// Adding the date to the mail
msg.setSentDate(new Date());
// Adding the mime multi part to the mail
msg.setContent(multipart); // send the thing off System.out.println("\nMessage ready sending Mail."); Transport.send(msg); System.out.println("\nMail was sent successfully.");
->