本文整理汇总了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();
}
示例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();
}
示例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;
}
示例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();
}
示例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;
}