c#邮件群发系统设计代码解析

c#邮件群发系统设计代码解析

ID:27884246

大小:219.00 KB

页数:21页

时间:2018-12-06

c#邮件群发系统设计代码解析_第1页
c#邮件群发系统设计代码解析_第2页
c#邮件群发系统设计代码解析_第3页
c#邮件群发系统设计代码解析_第4页
c#邮件群发系统设计代码解析_第5页
资源描述:

《c#邮件群发系统设计代码解析》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、邮件群发系统代码解析20112011/1/14Blog:xiaoyaosr.blog.51cto.com

2、逍遥散人Xiaoyaosr邮件群发系统代码解析作者:逍遥散人Blog:http://xiaoyaosr.blog.51cto.com邮件群发系统代码解析2011概要:子线程工作,发送成功邮件做标记,逐条提取数据,气泡提示信息,最小化到托盘,实时进度条代码:usingSystem;usingSystem.Collections;usingSystem.Collections.Generic;usi

3、ngSystem.ComponentModel;usingSystem.Data;usingSystem.Data.OleDb;usingSystem.Threading;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Net.Mail;usingSystem.Net;usingSystem.Text.RegularExpressions;namespaceMailGroupSends{publicpartialclassForm1:Fo

4、rm{publicForm1(){InitializeComponent();}privatestringsubject=string.Empty;privatestringmailto=string.Empty;privatestringbody=string.Empty;privateintsucNum=0;privateintTotalDate{get{if(this.txtDateCount.Text.Trim().Length>0)returnConvert.ToInt32(this.tx

5、tDateCount.Text.Trim());return4;}set{this.txtDateCount.Text=value.ToString();}}privatestringConnString作者:逍遥散人Blog:http://xiaoyaosr.blog.51cto.com邮件群发系统代码解析2011{get{stringpathFull=System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;string

6、path=pathFull.Substring(0,pathFull.LastIndexOf(@""));return@"Provider=Microsoft.Jet.OLEDB.4.0;DataSource="+path+@"mail.mdb";}}privateboolmailSent=false;//邮件是否发送成功privateintmailTotalCount=0;privateintCategoryId=0;privateintSentCount=0;//已发送数privateint

7、UnitConversion=1;//默认为秒///

///发送间隔///privateintInterval{get{inttimer=0;inttotalMis=(TotalDate*UnitConversion*1000);timer=totalMis/(mailTotalCount-SentCount);returntimer;}}//////提取邮件///privatevoidInitMailList(){OleDb

8、ConnectionConn=newOleDbConnection(ConnString);try{stringstrWhere=CategoryId==1000?"":"andcategoryid="+CategoryId+"orderbyisSend,uyx";stringsqlStr=@"selecttop1uyxfrom[usermail]whereisDelete=0andIsSend=0"+strWhere;if(Conn.State==ConnectionState.Closed)Co

9、nn.Open();作者:逍遥散人Blog:http://xiaoyaosr.blog.51cto.com邮件群发系统代码解析2011OleDbCommandcmd=newOleDbCommand(sqlStr,Conn);OleDbDataReaderreader=cmd.ExecuteReader();mailto=string.Empty;while(reader.Read()){mailto+=reader[0].ToString()+",";}reader.

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。