• Asp.net发送垃圾邮件(仅供娱乐)


         刚才在博客园发表了一篇文章,题目为

          [ 使用MailMessageSmtpClient类实现asp.net的邮箱发送,文章地址:http://www.cnblogs.com/gossip/archive/2010/03/23/1692639.html]

          有同学说太过简单,不便于发到首页,所以我又移到了候选页。后来继续研究了下,想实现定时发送邮件功能,没想到竟然发现发送垃圾邮件的方法。

          功能很简单,仅供娱乐。原理就是在Global.asax中开启一个现成,每隔一段时间就向指定邮箱发送邮件,具体发送代码见上篇文章。线程代码如下:

        

    代码
      void Application_Start(object sender, EventArgs e)
        {

            thread 
    = new System.Threading.Thread(new System.Threading.ThreadStart(WriteLog)); 
            thread.Start();
        }


        System.Threading.Thread thread;
        
    void WriteLog()
        {
            
    while (true)
            {
                SendEmail(); 
    //发送
                System.Threading.Thread.CurrentThread.Join(5000);//阻止五秒
            }
        }


  • 相关阅读:
    最全的常用正则表达式大全
    服务器调用JS
    ASP-----分页功能的实现
    流操作text文件------读取、保存文档
    linq to sql 增删改查
    数据库的高级应用
    SQL---------表的约束
    面向对象--继承练习
    Winform---文件夹操作
    面向对象--里氏转换练习
  • 原文地址:https://www.cnblogs.com/gossip/p/1692684.html
Copyright © 2020-2023  润新知