想写个邮件群发的软件 网上的代码都太老了有问题
好长时间没写了 当时用net.mail写过 但一直有问题
哪位高手有现成的打包一个给我呗
在此谢过了C#邮件群发邮件软件源码
好长时间没写了 当时用net.mail写过 但一直有问题
哪位高手有现成的打包一个给我呗
在此谢过了C#邮件群发邮件软件源码
解决方案 »
- C# WinForm中使用DevExpress DockManager控件问题 ?急急急
- WPF有关xaml中Grid.DataContext绑定为null,求解???
- System.Data.SqlClient.SqlException: 列名 '单位' 无效
- c# 文件排序
- 100分请问怎么一起部署SQLCE和.net compact项目到pocket pc中呢?
- 初学者请大虾们帮我看下那里错了
- 急,关于用WMI远程启动进程的问题!!!(高分100)
- C#如何实现类似于word的文件排版效果?
- VS2003访问SQL2000数据库的问题
- 有关dev的饼图,各位爷,求救啦。
- C#怎么检测当前摄像头是否已被打开?
- 请教一个很具体的问题,关于对象列表的读取和处理
//实例化SmtpClient
SmtpClient client = new SmtpClient("smtp.126.com", 25); //出站方式设置为NetWork
client.DeliveryMethod = SmtpDeliveryMethod.Network;
//smtp服务器验证并制定账号密码
client.Credentials = new NetworkCredential("[email protected]", "123"); MailMessage message = new MailMessage();
message.Priority = MailPriority.Normal; //设置优先级 message.SubjectEncoding = Encoding.GetEncoding("gb2312");//主题编码
message.BodyEncoding = Encoding.GetEncoding("gb2312"); //正文编码
message.IsBodyHtml = true;//邮件正文是否支持HTML message.From = new MailAddress("[email protected]", "标题", Encoding.GetEncoding("gb2312"));//设置收件方看到的邮件来源为:发送方邮件地址、来源标题、编码 message.To.Add(_sendTo);//接收方 message.Subject = _title; //标题
message.Body = _info;
client.Send(message);
很简单其实,你把需要群发的email address存放在数据库或者是xml==类型中,只要能读取的到就好。
最后用for循环或者是.net的Theard就ok了。
sing System;
using System.Threading;
public class Example {
public static void Main() {
// Queue the task.
ThreadPool.QueueUserWorkItem(new WaitCallback(ThreadProc)); Console.WriteLine("Main thread does some work, then sleeps.");
// If you comment out the Sleep, the main thread exits before
// the thread pool task runs. The thread pool uses background
// threads, which do not keep the application running. (This
// is a simple example of a race condition.)
Thread.Sleep(1000); Console.WriteLine("Main thread exits.");
} // This thread procedure performs the task.
static void ThreadProc(Object stateInfo) {
// No state object was passed to QueueUserWorkItem, so
// stateInfo is null.
Console.WriteLine("Hello from the thread pool.");
}
}
http://technet.microsoft.com/zh-cn/magazine/system.threading.threadpool(VS.90).aspx
发邮件方法参考:http://www.cnblogs.com/jeoleo/archive/2011/12/09/2254306.html