http://www.yesky.com/20010709/188347.shtml

解决方案 »

  1.   

    http://www.yesky.com/20010709/188347.shtml解决不了我的问题。
      

  2.   

    唉,又是一个被javamail搞趴下的兄弟http://www-900.ibm.com/developerWorks/cn/cnedu.nsf/java-onlinecourse-bytitle/97EB905362396BEB48256AFC002D91A6?OpenDocument
    有一个javamail的教程,你仔细看看吧pwd:以前我做webmail的时候,一开始想用javamail,结果发现太复杂了,最后还是自己写了一个邮件的parser,javamail太难用了。
      

  3.   

    好兄弟,公司老早就把QQ通信端口给封了,现在上不了QQ。
    时间比较紧。你处理的思路是?
    [email protected]
      

  4.   

    在解析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();
    }
      

  5.   

    图象可以显示在附件中,但是HTML这种邮件一定要显示HTML中包含的图片