blog.Toby

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  130 随笔 :: 2 文章 :: 150 评论 :: 0 Trackbacks

<%@ 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 渠上月 阅读(236) 评论(0)  编辑  收藏 所属分类: java tips

只有注册用户登录后才能发表评论。


网站导航: