Ejemplo n.º 1
0
    /// <summary>
    /// 发送站内短信

    /// </summary>
    private void SendLoginNameShort(string descript, DataTable dt)
    {
        Tz888.BLL.InnerInfo   infoBLL   = new Tz888.BLL.InnerInfo();
        Tz888.Model.InnerInfo infomodel = new Tz888.Model.InnerInfo();
        foreach (DataRow dataRow in dt.Rows)
        {
            infomodel.SendName    = loginname; //"020bluemax";//发件人
            infomodel.Topic       = "推广信息:" + title;
            infomodel.SendName    = loginname; //dataRow["loginname"].ToString().Trim();
            infomodel.Context     = descript;
            infomodel.InfoTime    = DateTime.Now;
            infomodel.ReceiveName = dataRow["loginname"].ToString().Trim(); //收件人"hellocindy";
            infomodel.ChangeBy    = loginname;                              //"020bluemax";//修改人

            bool statu = infoBLL.SendInfoBLL(infomodel, true);
            if (statu)
            {
                Tz888.BLL.SubscribeSet         bll   = new Tz888.BLL.SubscribeSet();
                Tz888.Model.SubscribeSetTabLog model = new Tz888.Model.SubscribeSetTabLog();
                model.LoginName = dataRow["loginname"].ToString().Trim();
                model.SubType   = "站内短信";
                model.Sid       = id;
                bll.Insert(model);
            }
        }
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 发送手机短信

    /// </summary>
    private void SendPhoneShort(string descript, DataTable dt)
    {
        foreach (DataRow dataRow in dt.Rows)
        {
            StringBuilder str         = new StringBuilder();
            string        MialAddress = dataRow["tel"].ToString().Trim();//"13537706502";
            string        MailMessage = descript;
            int           a           = send.SendSms(MialAddress, MailMessage);
            if (a > 0)
            {
                Tz888.BLL.SubscribeSet         bll   = new Tz888.BLL.SubscribeSet();
                Tz888.Model.SubscribeSetTabLog model = new Tz888.Model.SubscribeSetTabLog();
                model.LoginName = dataRow["loginname"].ToString().Trim();
                model.SubType   = "手机短信";
                model.Sid       = id;
                bll.Insert(model);
            }
        }
    }
Ejemplo n.º 3
0
 /// <summary>
 /// 发送Email短信
 /// </summary>
 private void SendEmailShort(string descript, string htmlFile, DataTable dt)
 {
     foreach (DataRow dataRow in dt.Rows)
     {
         #region 构建发邮件的格式
         StringBuilder str = new StringBuilder();
         str.Append("<html>");
         str.Append("<heat>");
         str.Append("<meta http-equiv=\"Content-Type\" content=\"text/html;charset=gb2312>");
         str.Append("<title>邮件推广信息</title>");
         str.Append("<body bgcolor=\"#FFFFFF\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">");
         str.Append("<table width=\"668\" height=\"705\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
         str.Append("<tr>");
         str.Append("<td colspan=\"3\">");
         str.Append("<img src=\"http://www.topfo.com/ADPage/yjtg/index_01.jpg\" width=\"668\" height=\"1\" alt=\"\"></td>");
         str.Append("</tr>");
         str.Append("</tr><tr><td colspan=\"3\">");
         str.Append("<img src=\"http://www.topfo.com/ADPage/yjtg/index_02.jpg\" alt=\"\" width=\"668\" height=\"146\" border=\"0\" usemap=\"#Map\"></td>");
         str.Append("</tr>");
         str.Append("<tr><td colspan=\"3\" valign=\"top\">");
         str.Append("<img src=\"http://www.topfo.com/ADPage/yjtg/index_03.jpg\" width=\"668\" height=\"188\" alt=\"\"></td>");
         str.Append("</tr><tr valign=\"middle\">");
         str.Append("<td width=\"25\">");
         str.Append("<img src=\"http://www.topfo.com/ADPage/yjtg/index_04.jpg\" width=\"25\" height=\"82\" alt=\"\"></td>");
         str.Append("<td width=\"614\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr>");
         str.Append("<td height=\"25\" colspan=\"2\" style=\"color:#333333; font-size: 13px; font-weight:bolder;\">");
         str.Append("尊敬的用户:中国招商投资网(Http://www.topfo.com)提醒您:您收到推荐资源。</td></tr> <tr>");
         str.Append("<td width=\"76%\" height=\"25\" style=\"color:#333333; font-size: 13px; font-weight:bolder;\">");
         str.Append("推荐的资源与您的需求非常匹配,请及时把握商机。</td>");
         str.Append(" <td width=\"24%\"><a href=\"http://member.topfo.com/Login.aspx?ReturnUrl=%2fPublish%2fpublishNavigate.aspx\">");
         str.Append("<img src=\"http://www.topfo.com/ADPage/yjtg/tt_08.jpg\" width=\"100\" border=\"0\" height=\"25\"></a></td>");
         str.Append("</tr></table></td><td>");
         str.Append("<div align=\"right\"><img src=\"http://www.topfo.com/ADPage/yjtg/index_06.jpg\" width=\"29\" height=\"82\" alt=\"\">");
         str.Append("</div></td>");
         str.Append("</tr><tr>");
         str.Append("<td colspan=\"3\" valign=\"top\">");
         str.Append("<img src=\"http://www.topfo.com/ADPage/yjtg/index_07.jpg\" width=\"668\" height=\"21\" alt=\"\">");
         str.Append("</td></tr><tr><td colspan=\"3\">");
         str.Append("<img src=\"http://www.topfo.com/ADPage/yjtg/index_08.jpg\" width=\"668\" height=\"38\" alt=\"\">");
         str.Append("</td></tr><tr><td>");
         str.Append("<img src=\"http://www.topfo.com/ADPage/yjtg/index_09.jpg\" width=\"25\" height=\"124\" alt=\"\">");
         str.Append("<td background=\"http://www.topfo.com/ADPage/yjtg/index_10.jpg\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
         str.Append("<tr><td style=\"color:#b40000; font-size:16px; font-weight:bolder;\">" + title + "</td></tr>");
         str.Append("<tr><td style=\"font-size:12px; line-height:18px; padding-top:5px;\">");
         str.Append("<strong>项目摘要:</strong>");
         str.Append(descript);
         str.Append("<span style=\"padding-left:30px;\"><a href=\"http://www.topfo.com/" + htmlFile + "\"><img src=\"http://www.topfo.com/ADPage/yjtg/tt_17.jpg\" width=\"74\" height=\"21\"></a></span>");
         str.Append("</td></tr> </table></td>");
         str.Append("<td><div align=\"right\"><img src=\"http://www.topfo.com/ADPage/yjtg/index_17.jpg\" width=\"29\" height=\"124\" alt=\"\">");
         str.Append("</div></td></tr><tr><td colspan=\"3\">");
         str.Append("<img src=\"http://www.topfo.com/ADPage/yjtg/index_13.jpg\" width=\"668\" height=\"28\" alt=\"\">");
         str.Append("</td></tr><tr><td colspan=\"3\">");
         str.Append("<img src=\"http://www.topfo.com/ADPage/yjtg/index_19.jpg\" width=\"668\" height=\"80\" alt=\"\">");
         str.Append("</td></tr></table><map name=\"Map\">");
         str.Append("<area shape=\"rect\" coords=\"10,9,209,68\" href=\"www.topfo.com\"><area shape=\"rect\" coords=\"170,72,527,153\" href=\"www.topfo.com\">");
         str.Append("</map></body></html>");
         str.Append("</body>");
         str.Append("</heat>");
         str.Append("</html>");
         #endregion
         string MialAddress = dataRow["email"].ToString().Trim(); //"*****@*****.**";
         string Mailtitle   = title;
         string MailMessage = str.ToString();
         bool   statu       = send.SendEmailMsg(MialAddress, Mailtitle, MailMessage);
         if (statu)
         {
             Tz888.BLL.SubscribeSet         bll   = new Tz888.BLL.SubscribeSet();
             Tz888.Model.SubscribeSetTabLog model = new Tz888.Model.SubscribeSetTabLog();
             model.LoginName = dataRow["loginname"].ToString().Trim();
             model.SubType   = "email短信";
             model.Sid       = id;
             bll.Insert(model);
         }
         str.Remove(0, str.Length);
     }
 }