JumboTCMS_src/JumboTCMS.Common/MailHelp.cs

(开头部分) 11KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/*
 * 程序名称: JumboTCMS(将博内容管理系统通用版)
 * 
 * 程序版本: 7.x
 * 
 * 程序作者: 子木将博 (QQ:791104444@qq.com,仅限商业合作)
 * 
 * 版权申明: http://www.jumbotcms.net/about/copyright.html
 * 
 * 技术答疑: http://forum.jumbotcms.net/
 * 
 */

using System;
using System.Configuration;
using System.Web;
using System.Data;
using System.Text;
using System.Collections;
namespace JumboTCMS.Common
{
    /// <summary>
    /// 发送邮件类
    /// </summary>
    public static class MailHelp
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="MailTimeCycle">单个邮箱发信的间隔周期</param>
        /// <returns></returns>
        public static JumboTCMS.Entity.MailServer MailServer(int MailTimeCycle)
        {
            string strXmlFile = HttpContext.Current.Server.MapPath("~/_data/config/jcms(emailserver).config");
            JumboTCMS.DBUtility.XmlControl XmlTool = new JumboTCMS.DBUtility.XmlControl(strXmlFile);
            DataTable dtTemp = XmlTool.GetTable("Mails");
            XmlTool.Dispose();
            System.Collections.IList _FromAddresss = new System.Collections.ArrayList();
            System.Collections.IList _FromNames = new System.Collections.ArrayList();
            System.Collections.IList _FromPwds = new System.Collections.ArrayList();
            System.Collections.IList _SmtpHosts = new System.Collections.ArrayList();
            System.Collections.IList _SmtpPorts = new System.Collections.ArrayList();
            System.Collections.IList _Useds = new System.Collections.ArrayList();
            if (dtTemp == null)
            {
                return null;
            }
            if (dtTemp.Rows.Count == 0)
            {
                return null;
            }
            dtTemp.DefaultView.Sort = "Used ASC";
            DataTable dt = dtTemp.DefaultView.ToTable();
            dtTemp.Clear();
            dtTemp.Dispose();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (string.CompareOrdinal(dt.Rows[i]["Used"].ToString(), DateTime.Now.AddSeconds(0 - MailTimeCycle).ToString("yyyy-MM-dd HH:mm:ss")) <= 0)//确保周期内只发送一次
                {
                    _FromAddresss.Add(dt.Rows[i]["FromAddress"].ToString());
后面还有 171 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。