当前位置: 首页>>代码示例>>C#>>正文


C# hMailServer.Add方法代码示例

本文整理汇总了C#中hMailServer.Add方法的典型用法代码示例。如果您正苦于以下问题:C# hMailServer.Add方法的具体用法?C# hMailServer.Add怎么用?C# hMailServer.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hMailServer的用法示例。


在下文中一共展示了hMailServer.Add方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreatePrintRecipientCountRule

        private void CreatePrintRecipientCountRule(hMailServer.Rules rules)
        {
            Rule oRule = rules.Add();
             oRule.Name = "Criteria test";
             oRule.Active = true;

             RuleCriteria oRuleCriteria = oRule.Criterias.Add();
             oRuleCriteria.UsePredefined = true;
             oRuleCriteria.PredefinedField = eRulePredefinedField.eFTMessageSize;
             oRuleCriteria.MatchType = eRuleMatchType.eMTGreaterThan;
             oRuleCriteria.MatchValue = "0";
             oRuleCriteria.Save();

             RuleAction oRuleAction = oRule.Actions.Add();
             oRuleAction.Type = eRuleActionType.eRARunScriptFunction;
             oRuleAction.ScriptFunction = "PrintRecipientCount";
             oRuleAction.Save();

             oRule.Save();

             File.WriteAllText(_settings.Scripting.CurrentScriptFile,
                           "Sub PrintRecipientCount(oMessage)" + Environment.NewLine +
                           " Call EventLog.Write(oMessage.Recipients.Count)" + Environment.NewLine +
                           "End Sub");

             _settings.Scripting.Reload();
        }
开发者ID:digitalsoft,项目名称:hmailserver,代码行数:27,代码来源:Rules.cs

示例2: CreateMoveRule

        private void CreateMoveRule(hMailServer.Rules ruleContainer, string foldername)
        {
            hMailServer.Rule oRule = ruleContainer.Add();
             oRule.Name = "Criteria test";
             oRule.Active = true;

             hMailServer.RuleCriteria oRuleCriteria = oRule.Criterias.Add();
             oRuleCriteria.UsePredefined = true;
             oRuleCriteria.PredefinedField = hMailServer.eRulePredefinedField.eFTMessageSize;
             oRuleCriteria.MatchType = hMailServer.eRuleMatchType.eMTGreaterThan;
             oRuleCriteria.MatchValue = "0";
             oRuleCriteria.Save();

             hMailServer.RuleAction oRuleAction = oRule.Actions.Add();
             oRuleAction.Type = hMailServer.eRuleActionType.eRAMoveToImapFolder;
             oRuleAction.IMAPFolder = foldername;
             oRuleAction.Save();

             oRule.Save();
        }
开发者ID:nberardi,项目名称:hMailServer,代码行数:20,代码来源:IMAP.MessageUids.cs

示例3: AddDomain

        public hMailServer.Domain AddDomain(hMailServer.Domains oDomains, string sName)
        {
            hMailServer.Domain oDomain = oDomains.Add();
             oDomain.Name = sName;
             oDomain.Active = true;
             oDomain.Save();

             return oDomain;
        }
开发者ID:nberardi,项目名称:hMailServer,代码行数:9,代码来源:Utilities.cs

示例4: CreateMessageModificationRule

        private void CreateMessageModificationRule(hMailServer.Rules ruleContainer)
        {
            hMailServer.Rule oRule = ruleContainer.Add();
             oRule.Name = "Criteria test";
             oRule.Active = true;

             hMailServer.RuleCriteria oRuleCriteria = oRule.Criterias.Add();
             oRuleCriteria.UsePredefined = true;
             oRuleCriteria.PredefinedField = hMailServer.eRulePredefinedField.eFTMessageSize;
             oRuleCriteria.MatchType = hMailServer.eRuleMatchType.eMTGreaterThan;
             oRuleCriteria.MatchValue = "0";
             oRuleCriteria.Save();

             hMailServer.RuleAction oRuleAction = oRule.Actions.Add();
             oRuleAction.Type = hMailServer.eRuleActionType.eRARunScriptFunction;
             oRuleAction.ScriptFunction = "ModifyMessage";
             oRuleAction.Save();

             oRule.Save();

             File.WriteAllText(_settings.Scripting.CurrentScriptFile, "Sub ModifyMessage(oMessage)" + Environment.NewLine +
                                                                     "oMessage.Subject = \"[Spam] \" + CStr(oMessage.Subject)" + Environment.NewLine +
                                                                     "oMessage.Save" + Environment.NewLine +
                                                                  "End Sub");

             _settings.Scripting.Reload();
        }
开发者ID:nberardi,项目名称:hMailServer,代码行数:27,代码来源:IMAP.MessageUids.cs

示例5: AddAccount

        public hMailServer.Account AddAccount(hMailServer.Accounts accounts, string sAddress, string sPassword)
        {
            hMailServer.Account oAccount = accounts.Add();
             oAccount.Address = sAddress;
             oAccount.Password = sPassword;
             oAccount.Active = true;
             oAccount.Save();

             return oAccount;
        }
开发者ID:nberardi,项目名称:hMailServer,代码行数:10,代码来源:Utilities.cs


注:本文中的hMailServer.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。