资讯   |   开发   |   选机中心   |   产品大全 | IBM | 惠普 | 联想 | 戴尔 | 苹果 | 神舟
更多: | 华硕 | 明基 | 方正 | 紫光 | TCL | 夏新 | 联宝 | 宏碁 | 七喜 | 长城 | 清华同方 | 海尔 | 三星 | 东芝 | 索尼 | 富士通 | LG | 技术 | ddnoon
当前位置:笔记本 > 软件开发 >
Advertisement
文章正文

ASP中群发邮件问题

类型:转载   责任编辑:asp.net   日期:2007/05/23


热门软件下载:


   

不知道大家在ASP中群发邮件时使用什么组件?  
  我使用CDONTS.NewMail,可是发送成功的概率太低了,  
  经常收不到!  
 

网友回答:

发表者:bananasmiling

我刚才下载了一个JMAIL.测试成功..现在把过程发给你..  
  先下载一个JMAIL.EXE   ..下载地址:http://www.china-site.com/site/clientinfo/download.asp   常用软件   6..JMAIL   4.3..然后安装一下..  
  2.然后你测试我这两个程序..  
  一定能收到邮件了..有些地方改成你的邮件服务器发送..  
  JMAIL1.HTM  
   
  <html>  
  <head>  
  <title>信息反馈表</title>  
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">  
  </head>  
   
  <body   bgcolor="#FFFFFF"   text="#000000">  
  <form   action="jmail.asp"   method="post"   name="mywebmail">  
      <p>您的姓名:      
          <input   type="text"   name="name"   size="20"   maxlength="50">  
      </p>  
      <p>电子邮箱:      
          <input   type="text"   name="email"   size="20"   maxlength="60">  
      </p>  
      <p>邮件主题:      
          <input   name="subject"   type="text"   id="subject"   size="30"   maxlength="100">  
      </p>  
      <p>留言内容一:   <br/>  
          <textarea   name="body1"   cols="40"   rows="4"   id="body1">dfgsdfg</textarea>  
      </p>  
      <p>留言内容二:   <br/>  
          <textarea   name="body2"   cols="40"   rows="4"   id="body2">sfasdf</textarea>  
          <br/>  
          <br/>  
          <input   type="submit"   value="确认递交"   name="submit">  
          <input   type="reset"   value="清除重写"   name="clear">    
      </p>  
      </form>  
   
  </body>  
  </html>  
   
   
   
   
 

发表者:bananasmiling

jmail.asp  
   
  <%@   Language=VBScript   %>  
   
  <%    
  Dim   JMail  
   
   
  t=Request("Body1")  
  t1=Request("Body2")  
  Set   JMail=server.createobject("JMail.Message")  
   
  JMail.silent   =   true    
  JMail.Logging   =   true    
  JMail.Charset   =   "gb2312"    
  JMail.MailServerUserName   =   "liuixao"   输入smtp服务器验证登陆名     -----改  
  JMail.MailServerPassword   =   "649"   输入smtp服务器验证密码     -----改  
  JMail.From   =   Request.Form("email")   发件人Email    
  JMail.FromName   =   Request.Form("name")   发件人姓名    
  JMail.AddRecipient   "liu@.sina.net"   收件人Email,多个收件人,就重复多行   -----改  
  JMail.AddRecipient   "info@cnkl.net"   第二个收信地址----改成N个地址  
   
   
  JMail.Subject   =   Request.Form("subject")   信件主题    
  JMail.Body   ="内容1:"   &t&   vbcrlf   &   "内容2:"&t1     换行符     &   vbcrlf   &  
  JMail.Send   ("你的邮件服务器地址")   smtp服务器地址-----改  
  JMail.Priority=2  
  JMail.Close()  
  set   JMail   =   nothing    
  %>  
  <br/>  
  <p   align="center">邮件发送成功,谢谢使用!</p>  
   
   
  以上两个程序经过本人测试..一定能收到信..而且能给客户回信..  
   
   
   
 

发表者:windok2004

在JMail.AddRecipient   "liu@.sina.net"这里做一个循环啊

发表者:wxrf2000

多个页面同时运行即可。

发表者:xiaowenand

<%  
   
  server.scripttimeout=99999999  
   
  if   trim(request("submit"))<>""   then  
   
      connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data   Source="   &   Server.MapPath("db1.mdb")  
   
    set   conn=Server.CreateObject("adodb.connection")  
   
    conn.open   connstr  
   
  title=trim(request("title"))  
   
  body=trim(request("body"))  
   
  if   title=""   then  
   
  response.write   "标题不能为空!"  
   
  response.end  
   
  end   if  
   
  if   body=""   then  
   
  response.write   "内容不能为空呀!"  
   
  response.end  
   
  end   if  
   
  sql="select   *   from   Ddd"  
   
  set   rs=conn.execute(sql)  
   
  countit=0  
   
  sub   sendmail(user,email,title,body)  
   
  set   msg   =   Server.CreateOBject(   "JMail.Message"   )  
   
  msg.Logging   =   true  
   
  msg.silent   =   true  
   
  msg.mailserverpassword="test_pass"  
   
  msg.mailserverusername="test@hkeb.com"  
   
  msg.From   =   "info@hkeb.com"  
   
  msg.FromName   =   "中时空网络(3CTS.COM)"  
   
  msg.AddRecipient   email,   user  
   
  msg.Subject   =   title  
   
  msg.Body   =   body  
   
  if   not   msg.Send(   "mail.3cts.com"   )   then  
   
  Response.write   "<pre>"   &   msg.log   &   "</pre>"  
   
  else  
   
  Response.write   "发送:"&user&"   |   "&email&"   成功!<br>"  
   
  response.flush  
   
  end   if  
   
  end   sub  
   
  while   not   rs.eof  
   
  email=rs(3)这里是邮件地址列  
   
  user=rs(2)  
   
  countit=countit+1  
   
  sendmail   user,email,title,body  
   
  rs.movenext  
   
  wend  
   
  response.write   "计发出:"&countit&"封信"  
   
  response.end  
   
  else  
   
  %>  
   
  <title>中时空邮件群发</title>    
   
  <form   name="form1"   method="post"   action="sendemail.asp">  
   
      <table   width="80%"   border="0"   align="center"   cellpadding="1"   cellspacing="1"   bgcolor="#CCCCCC">  
   
          <tr>    
   
              <td   colspan="2">   </td>  
   
          </tr>  
   
          <tr   bgcolor="#FFFFFF">    
   
              <td   width="21%"   align="right">标题:</td>  
   
              <td   width="79%"><input   name="title"   type="text"   id="title"></td>  
   
          </tr>  
   
          <tr   bgcolor="#FFFFFF">    
   
              <td   align="right">内容:</td>  
   
              <td><textarea   name="body"   cols="60"   rows="10"   id="body"></textarea></td>  
   
          </tr>  
   
          <tr>    
   
              <td>   </td>  
   
              <td><input   type="submit"   name="Submit"   value="Submit">  
   
                  <input   type="reset"   name="Submit2"   value="Reset"></td>  
   
          </tr>  
   
      </table>  
   
  </form>  
   
  <%  
   
  end   if  
   
  %>    
   
   
     
   
   
  说明:  
   
  1,本程序源码是JMAIL4.3个人版的发信程序.本来JMAIL有群发的功能.但因为是  
   
      FREE版本~因此它限制了群发.只能靠循环来群发.  
   
   
  2,本程序调用数据库中的邮件列表数据来群发.   在群发之前请要确定你的数据库名  
   
      与数据库路径是否正确!而且你的用户名与邮件地址的位置是否正确!  
   
      即RS(2)应该是你的用户名字.RS(3)应该是你的用户的邮件地址.  
   
   
  3,本程序采用的是SMTP授权认证.因此你可以使用任何一下SMTP服务器发信.只要你  
   
      拥有此SMTP服务器的用户名与密码.比WWW.21CN.COM下的用户.只要更改上头的  
   
      mailserverpassword   与mailserverusername为你在21CN.COM注册的用户名与密码.  
   
      用户名应该是完整的邮箱地址.  
   
   
  4,因为是授权认证.事实上的这个群发并不能对服务器造成太多的影响.但依发信的内容  
   
      多少而会有不少的发信的时间.这是一定的.:)  
   
   
   
  5,根据测试发信一千封信的时间大概在二分钟内完成.大小至少有三K,而现场的CPU监测发现服务器的CPU占用竟出奇的低.事实上这也是一个必然.因为是授权发信!当然你可以不必用授权发信.  
   
   
  6,可以自定义发信的标题与发信的内容.当然你还可以修改成自定义一切.:)  
   
   
  7,实时可知目前发信的深度与速度:)试试就知道了.  
   
   
  8,声明:3CTS.COM不对此程序造成的恶劣影响负任何责任.  
   
   
  9,JMAIL4.3个人版下载地址:http://www.wrclub.net/down/show.asp?id=804  
   
   
  10,JMAILserver服务器下载:http://www.wrclub.net/down/show.asp?id=805  
   
 

发表者:xjy521

Function   sendMail(MailFrom,MailTo,MailSubject,MailBody)  
  Dim   objMail  
  sendMail=false  
  Set   objMail   =   Server.CreateObject("CDONTS.NewMail")  
  objMail.From   =   MailFrom  
  objMail.To   =   MailTo  
  objMail.Subject   =     MailSubject  
  objMail.Body   =   MailBody  
  objMail.BodyFormat=0  
  objMail.MailFormat=0  
  objMail.Send  
  Set   objMail   =   Nothing  
  sendMail=true  
  End   Function  
  if   request("MailSubject")<>""   and   request("MailBody")<>""   then  
  MailSubject=request("MailSubject")  
  MailBody=request("MailBody")  
  MailFrom="sdf@sf.com"  
  strsql="select   *   from   email_msg"  
  set   rs_email=cnndb.execute(strsql)  
  if   not   rs_email.eof   then  
  do   while   not   rs_email.eof    
  M_Email=rs_email("email")  
  sendMail   MailFrom,M_Email,MailSubject,MailBody    
  rs_email.movenext  
  loop  
  end   if  
  response.write   "<script>alert(发送成功!!!);</script>"  
  end   if

发表者:sywcf

1.虽然楼上各说其词,但实际上群发不是那么简单的。  
  2.如用smtp认证方式发信:要用多个smtp服务器,多个DNS服务器,间隔一定时间发信,一次不能发太多  
  的邮件.  
  3.虽然显示邮件发送过去了,但实际上对方不一定收到邮件.  
  4.比如:用163的服务器转发,如果你发500封,那么邮箱将被封掉了。  
  5.可采用特快专递方式发信.


 

 
热门推荐笔记本: IBM笔记本
相关文章:
笔记本相关:
IT技术文章:
webmaster:popbb@126.com   最佳浏览:1024X768 MSIE
©2007 popbb.net All Rights Reserved