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
          主站蜘蛛池模板: 玉环县| 禹州市| 湖南省| 吴桥县| 阳东县| 南充市| 元朗区| 营口市| 社会| 德兴市| 拜城县| 丰宁| 沈阳市| 江安县| 彝良县| 达州市| 镇远县| 萨迦县| 富顺县| 马龙县| 炎陵县| 太仓市| 奇台县| 凤山市| 汤阴县| 祁东县| 克拉玛依市| 阿拉善盟| 格尔木市| 灵川县| 丰台区| 嘉禾县| 石柱| 赣榆县| 江口县| 六盘水市| 溧水县| 扶沟县| 巫溪县| 黄平县| 葵青区|