blog.Toby

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            130 隨筆 :: 2 文章 :: 150 評論 :: 0 Trackbacks
          <2005年12月>
          27282930123
          45678910
          11121314151617
          18192021222324
          25262728293031
          1234567

          常用鏈接

          留言簿(3)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          Securities

          文章

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          <%@ page import="java.sql.*" %>
          <%@ page import="java.util.*" %>
          <%@ page import="com.investoday.database.Database" %>
          <%@ page import="com.investoday.util.StringUtil" %>
          <%@ page import="com.investoday.util.EmailBean" %>
          <%@ page import="java.util.Date" %>
          <%@ page import="com.investoday.util.SmtpMail"%>
          <%@ page import ="java.io.*"%>
          <%@ page import = "java.io.IOException"%>

          <%
          String guids = request.getParameter("ids");
          String[] guid = guids.split(",");

          String name = "";//用戶姓名
          String to = ""; //收件人
          String content="";  //信件內容
          String subject = "郵件主題";
          String path="";
          String qid = "";
          String qno = "";
          String month = "";
          String month_h = "";
          String jobcls = "";//職位分類

          String strSql = "";
          String str = "";
          if(guid!=null&&guid.length>0)
          {
              for(int i=1;i<guid.length;i++) //批量發送
            {
              StringBuffer sb = new StringBuffer();
           try
           {  
            path=application.getRealPath("sales\\return_wq.htm");     //郵件模版 
            BufferedReader in = new BufferedReader(new FileReader(path));                     
            while ((str = in.readLine()) != null)
            {
             sb.append(str);
            }
            content=new String(sb);
            in.close();
           }
           catch (IOException e)
           {
            e.printStackTrace() ;
           }
           
           content = StringUtil.replace(content,"rp004","替換內容");
           //String sFileName = "E:\\crm\\app\\webapp\\sales\\7monthReturn.pdf";//附件
           
           SmtpMail smtpmail = new SmtpMail();
           
           smtpmail.setTo(to);  //對方地址
           smtpmail.setSubject(StringUtil.getGbcode(subject));
           smtpmail.setContent(content);//內容
           //smtpmail.setFile(sFileName);
           smtpmail.sendEmail();//調用方法發送郵件
          %>

          posted on 2005-12-28 15:49 渠上月 閱讀(283) 評論(0)  編輯  收藏 所屬分類: java tips
          主站蜘蛛池模板: 高州市| 广州市| 彝良县| 东城区| 繁峙县| 阜康市| 广安市| 赞皇县| 孟津县| 枣阳市| 宁乡县| 乐至县| 雷山县| 泸西县| 习水县| 小金县| 兰考县| 大庆市| 茌平县| 鸡西市| 新余市| 响水县| 洛川县| 滨州市| 桓仁| 内黄县| 怀仁县| 平凉市| 砀山县| 孟村| 武穴市| 吉木萨尔县| 囊谦县| 永定县| 台东县| 邯郸县| 东阳市| 五华县| 双柏县| 呼图壁县| 保德县|