如题
    不能使用smtp.qq.com服务,因为QQ有限制发送数量  大概发个几百封就不能发了
而我需要发送1W封左右的邮件 ,求代码
    希望发的代码经过测试的

解决方案 »

  1.   

    那就多注册几个qq号码。
    如果用的adsl,每次发送100封后,adsl重新拨号。
      

  2.   

    qq smtp限制,岂能是代码能解决的问题。
      

  3.   


    MailMessage message = new MailMessage();
            //获取发送者地址
            message.From = new MailAddress("[email protected]");
            //获取主题
            message.Subject = "test";
            //获取发送邮件主题
            message.Body = "test";
            message.IsBodyHtml = true;
            ////设置数据库链接
            //SqlConnection conn = new SqlConnection(getstring());
            //conn.Open();
            ////数据查询用的是存储过程
            //SqlCommand cmd = new SqlCommand("SelectEmail", conn);
            //cmd.CommandType = CommandType.StoredProcedure;
            //SqlParameter dutyparameter = cmd.Parameters.Add("@MemberDuty", SqlDbType.NVarChar, 20);
            //dutyparameter.Value = ddl_selectemail.SelectedValue;
            //SqlDataReader dr = cmd.ExecuteReader();
            ////执行查询获得要发往的邮件地址
            //while (dr.Read())
            //{
                message.To.Add("[email protected]");      //  }
           // conn.Close();
            SmtpClient client = new SmtpClient();
            client.Send(message);web.config加上:
      <system.net>
        <mailSettings>
          <smtp>
            <network host="smtp.163.com" port="25" userName="[email protected]" password="*******" />
          </smtp>
        </mailSettings>
      </system.net>
      

  4.   

    这玩意以前我做过,
    我告诉你怎么整:
    你先多注册几个邮箱,如QQ的,GMAIL的,SINA的,
    然后分别对应各个邮箱配置发送主机,用户名、密码、是否启用SSL,对应端口号之类的,GMAIL的是必须启用SSL,其端口好象是587,其它的好象默认就行。
    做完这些后,就直接发送邮件就行了,如果发送时出现异常,如果你是用带ADSL的机器发送邮件,则可以重新拔号,重新拔号代码网上有,如果你找不着,可以给我发消息,我可以发给你;
    如果不是ADSL,那你就先暂停一段时间再发送;
    使用多个邮箱发邮件,可以避免频繁被服务器屏蔽的频率
      

  5.   

    //利用System.Web.Mail;
            private bool SendMailByWeb()
            {
                //创建MailMessage对象   
                System.Web.Mail.MailMessage mailMsg = new System.Web.Mail.MailMessage();
                //设置收件人的邮件地址   
                mailMsg.To = "[email protected]";
                //设置发送者的邮件地址   
                mailMsg.From = "[email protected]";
                //设置邮件主题   
                mailMsg.Subject = "主题";
                //设置邮件内容   
                mailMsg.BodyFormat = System.Web.Mail.MailFormat.Html;            mailMsg.Body = "邮件内容";            //设置支持服务器验证   
                mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
                //设置用户名   
                mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "帐号@qq.com");
                //设置用户密码   
                mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "密码");
                try
                {
                    //设置发送邮件服务器    202.108.5.142
                    System.Web.Mail.SmtpMail.SmtpServer = "smtp.qq.com";
                    //发送邮件   
                    System.Web.Mail.SmtpMail.Send(mailMsg);
                    return true;
                }
                catch
                {
                    return false;
                }
            }
      

  6.   

    zhgroup
     
    (王员外) 
    给我弄哈呗  我邮箱注册了一大堆  基本上每一个邮箱服务器都有限制  发送个200封左右就不能发了
      

  7.   

    wangxiaofeiwuqiao
     
    (每天进步一点点) 
    我自己配的邮件服务器 发不出去邮件  你会配么
      

  8.   


    http://zhidao.baidu.com/question/126958118.html
      

  9.   

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.IO;
    using System.Collections;
    using System.Net;
    using System.Net.Mail;namespace entranceSendMail
    {
        public class SendMail
        {
            public static string host = "smtp.163.com";
          
            public void Send(string from,string[] mailTo, string subject, string body,string[] attachments)
            {
                MailMessage message = new MailMessage();
                message.From = new MailAddress(from, "tradeweb");
                for (int i = 0; i < mailTo.Length; i++)
                {
                    message.To.Add(mailTo[i].ToString());
                }
                message.Subject = subject;
                message.Body = body;
                message.BodyEncoding = System.Text.Encoding.UTF8;
                message.Priority = MailPriority.Normal;
                for (int i = 0; i < attachments.Length; i++)
                {
                    message.Attachments.Add(new Attachment(attachments[i].ToString()));
                }            try
                {
                    SmtpClient smtp = new SmtpClient(host,25);
                    smtp.UseDefaultCredentials = false;
                    smtp.Credentials = new System.Net.NetworkCredential(userName, password);
                    smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
                    smtp.Send(message);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
    }