Esempio n. 1
0
    //向当前用户的直接领导发送邮件提醒功能
    public static void SendMailToLeader(string title, string remark, string url)
    {
        string user1  = HttpContext.Current.User.Identity.Name;
        string leader = null;

        if (String.IsNullOrEmpty(user1) == false)
        {
            U_UserNameBU userBU = new U_UserNameBU();
            leader = userBU.GetDirLeader();
            userBU.Close();
        }

        if (leader != null)
        {
            ZX_EmailBu email1 = new ZX_EmailBu();
            Hashtable  ht     = new Hashtable();
            ht["time0"]  = System.DateTime.Now.ToString();
            ht["title"]  = title;
            ht["remark"] = remark;
            ht["from1"]  = user1;
            ht["to1"]    = leader;
            ht["back"]   = "1";
            ht["url"]    = url;

            email1.AddMail(ht);
            email1.Close();
        }
    }