收邮件(图像)-->显示邮件(图像)问题 http://www.yesky.com/20010709/188347.shtml 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://www.yesky.com/20010709/188347.shtml解决不了我的问题。 唉,又是一个被javamail搞趴下的兄弟http://www-900.ibm.com/developerWorks/cn/cnedu.nsf/java-onlinecourse-bytitle/97EB905362396BEB48256AFC002D91A6?OpenDocument有一个javamail的教程,你仔细看看吧pwd:以前我做webmail的时候,一开始想用javamail,结果发现太复杂了,最后还是自己写了一个邮件的parser,javamail太难用了。 好兄弟,公司老早就把QQ通信端口给封了,现在上不了QQ。时间比较紧。你处理的思路是?[email protected] 在解析HTML的时候,图片的<img src=***>可能被代替掉了,你要换回来。 /* * 把html中的CID转换成filename */ private void upDate() throws IOException { if(v == null) { (new File(attachDir + "temp.html")).renameTo(new File(attachDir + "Unknown.html")); return; } String tempStr; StringBuffer tempStrBuf = new StringBuffer(""); new File(attachDir + "Unknown.html").createNewFile(); BufferedReader fin = new BufferedReader(new FileReader(attachDir + "temp.html")); PrintWriter pw = new PrintWriter(new FileWriter(attachDir + "Unknown.html")); while((tempStr = fin.readLine()) != null) { tempStrBuf.append(tempStr + "\r\n"); } fin.close(); new File(attachDir + "temp.html").delete(); tempStr = tempStrBuf.toString(); String tempStr1 = "", tempStr2 = "", tempStr3 = ""; int split; java.util.Enumeration e = v.elements(); while(e.hasMoreElements()) { tempStr1 = (String)e.nextElement(); tempStr2 = tempStr1.substring(0,tempStr1.indexOf("|")); tempStr3 = tempStr1.substring(tempStr1.indexOf("|") + 1, tempStr1.length()); split = tempStr.indexOf(tempStr3); tempStr = new StringBuffer(tempStr.substring(0,split)).append(Config.getInstance().serverDomain) .append("/servlet/com.NorVa.Mail.AttachServlet?attachment=") .append(tempStr2) .append(tempStr.substring(split + tempStr3.length(),tempStr.length())) .toString(); } pw.println(tempStr); pw.flush(); pw.close(); } 图象可以显示在附件中,但是HTML这种邮件一定要显示HTML中包含的图片 java 数据库保存图片文件抛出异常 新手写代码出错,代码 关于JScrollPane滚动面板的问题 100分求助,URL传递“+”变空格的问题!!! 静态和非静态方法使用问题 求正则表达式,谢谢 java这种语法是啥意思?菜鸟问题 打包运行时报错,请高手帮我看看,谢谢! 我写的计算闰年问题(有个编译错误,请大家指点) 关于鼠标拖拽?? 如何删除文件? 要在servlet里连接oracle应该配置什么环境
有一个javamail的教程,你仔细看看吧pwd:以前我做webmail的时候,一开始想用javamail,结果发现太复杂了,最后还是自己写了一个邮件的parser,javamail太难用了。
时间比较紧。你处理的思路是?
[email protected]
* 把html中的CID转换成filename
*/
private void upDate() throws IOException {
if(v == null) {
(new File(attachDir + "temp.html")).renameTo(new File(attachDir + "Unknown.html"));
return;
}
String tempStr;
StringBuffer tempStrBuf = new StringBuffer("");
new File(attachDir + "Unknown.html").createNewFile();
BufferedReader fin = new BufferedReader(new FileReader(attachDir + "temp.html"));
PrintWriter pw = new PrintWriter(new FileWriter(attachDir + "Unknown.html"));
while((tempStr = fin.readLine()) != null) {
tempStrBuf.append(tempStr + "\r\n");
}
fin.close();
new File(attachDir + "temp.html").delete();
tempStr = tempStrBuf.toString();
String tempStr1 = "", tempStr2 = "", tempStr3 = "";
int split;
java.util.Enumeration e = v.elements();
while(e.hasMoreElements()) {
tempStr1 = (String)e.nextElement();
tempStr2 = tempStr1.substring(0,tempStr1.indexOf("|"));
tempStr3 = tempStr1.substring(tempStr1.indexOf("|") + 1, tempStr1.length());
split = tempStr.indexOf(tempStr3);
tempStr = new StringBuffer(tempStr.substring(0,split)).append(Config.getInstance().serverDomain)
.append("/servlet/com.NorVa.Mail.AttachServlet?attachment=")
.append(tempStr2)
.append(tempStr.substring(split + tempStr3.length(),tempStr.length()))
.toString();
}
pw.println(tempStr);
pw.flush();
pw.close();
}