本文整理汇总了C#中WebsitePanel.Providers.Mail.MailAccount类的典型用法代码示例。如果您正苦于以下问题:C# MailAccount类的具体用法?C# MailAccount怎么用?C# MailAccount使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MailAccount类属于WebsitePanel.Providers.Mail命名空间,在下文中一共展示了MailAccount类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SaveItem
public void SaveItem(MailAccount item)
{
item.FullName = txtFullName.Text;
item.IceWarpAccountType = Convert.ToInt32(ddlAccountType.SelectedValue);
item.IceWarpAccountState = Convert.ToInt32(ddlAccountState.SelectedValue);
item.IceWarpRespondType = Convert.ToInt32(ddlRespondType.SelectedValue);
if (!string.IsNullOrWhiteSpace(txtRespondPeriodInDays.Text))
{
item.RespondPeriodInDays = Convert.ToInt32(txtRespondPeriodInDays.Text);
}
item.RespondOnlyBetweenDates = chkRespondOnlyBetweenDates.Checked;
item.RespondFrom = calRespondFrom.SelectedDate;
item.RespondTo = calRespondTo.SelectedDate;
item.RespondWithReplyFrom = txtRespondWithReplyFrom.Text;
item.ResponderSubject = txtSubject.Text;
item.ResponderMessage = txtMessage.Text;
item.ForwardingEnabled = !string.IsNullOrWhiteSpace(txtForward.Text);
item.ForwardingAddresses = Utils.ParseDelimitedString(txtForward.Text, ';', ' ', ',');
item.DeleteOnForward = cbDeleteOnForward.Checked;
item.IsDomainAdmin = cbDomainAdmin.Checked;
item.DeleteOlder = cbDeleteOlder.Checked;
item.DeleteOlderDays = string.IsNullOrWhiteSpace(txtDeleteOlderDays.Text) ? 0 : Convert.ToInt32(txtDeleteOlderDays.Text);
item.ForwardOlder = cbForwardOlder.Checked;
item.ForwardOlderDays = string.IsNullOrWhiteSpace(txtForwardOlderDays.Text) ? 0 : Convert.ToInt32(txtForwardOlderDays.Text);
item.ForwardOlderTo = txtForwardOlderTo.Text;
}
开发者ID:jonwbstr,项目名称:Websitepanel,代码行数:28,代码来源:IceWarp_EditAccount.ascx.cs
示例2: SaveItem
public void SaveItem(MailAccount item)
{
item.ResponderEnabled = chkResponderEnabled.Checked;
item.ResponderSubject = txtSubject.Text;
item.ResponderMessage = txtMessage.Text;
item.ForwardingAddresses = Utils.ParseDelimitedString(txtForward.Text, ';', ' ', ',');
}
开发者ID:jordan49,项目名称:websitepanel,代码行数:7,代码来源:ArgoMail_EditAccount.ascx.cs
示例3: BindItem
public void BindItem(MailAccount item)
{
chkResponderEnabled.Checked = item.ResponderEnabled;
txtSubject.Text = item.ResponderSubject;
txtMessage.Text = item.ResponderMessage;
txtForward.Text = item.ForwardingAddresses != null ? String.Join("; ", item.ForwardingAddresses) : "";
}
开发者ID:jordan49,项目名称:websitepanel,代码行数:7,代码来源:ArgoMail_EditAccount.ascx.cs
示例4: CreateAccount
public override void CreateAccount(MailAccount mailbox)
{
try
{
svcUserAdmin users = new svcUserAdmin();
PrepareProxy(users);
GenericResult1 result = users.AddUser(AdminUsername, AdminPassword,
mailbox.Name,
mailbox.Password,
GetDomainName(mailbox.Name),
mailbox.FirstName,
mailbox.LastName,
false //domain admin is false
);
if (!result.Result)
throw new Exception(result.Message);
// set forwarding settings
result = users.UpdateUserForwardingInfo(AdminUsername, AdminPassword,
mailbox.Name, mailbox.DeleteOnForward,
(mailbox.ForwardingAddresses != null ? String.Join(", ", mailbox.ForwardingAddresses) : ""));
if (!result.Result)
throw new Exception(result.Message);
// set additional settings
result = users.SetRequestedUserSettings(AdminUsername, AdminPassword,
mailbox.Name,
new string[]
{
"isenabled=" + mailbox.Enabled.ToString(),
"maxsize=" + mailbox.MaxMailboxSize.ToString(),
"passwordlocked=" + mailbox.PasswordLocked.ToString(),
"replytoaddress=" + (mailbox.ReplyTo != null ? mailbox.ReplyTo : ""),
"signature=" + (mailbox.Signature != null ? mailbox.Signature : ""),
"spamforwardoption=none"
});
if (!result.Result)
throw new Exception(result.Message);
// set autoresponder settings
result = users.UpdateUserAutoResponseInfo(AdminUsername, AdminPassword,
mailbox.Name,
mailbox.ResponderEnabled,
(mailbox.ResponderSubject != null ? mailbox.ResponderSubject : ""),
(mailbox.ResponderMessage != null ? mailbox.ResponderMessage : ""));
if (!result.Result)
throw new Exception(result.Message);
}
catch (Exception ex)
{
throw new Exception("Could not create mailbox", ex);
}
}
开发者ID:lwhitelock,项目名称:Websitepanel,代码行数:59,代码来源:SmarterMail3.cs
示例5: BindItem
public void BindItem(MailAccount item)
{
chkResponderEnabled.Checked = item.ResponderEnabled;
txtSubject.Text = item.ResponderSubject;
txtMessage.Text = item.ResponderMessage;
txtForward.Text = item.ForwardingAddresses != null ? String.Join("; ", item.ForwardingAddresses) : "";
txtFirstName.Text = item.FirstName;
txtLastName.Text = item.LastName;
cbRetainLocalCopy.Checked = item.RetainLocalCopy;
}
开发者ID:jordan49,项目名称:websitepanel,代码行数:10,代码来源:MDaemon_EditAccount.ascx.cs
示例6: BindItem
public void BindItem(MailAccount item)
{
txtFirstName.Text = item.FirstName;
txtLastName.Text = item.LastName;
txtSignature.Text = item.Signature;
chkResponderEnabled.Checked = item.ResponderEnabled;
txtReplyTo.Text = item.ReplyTo;
txtSubject.Text = item.ResponderSubject;
txtMessage.Text = item.ResponderMessage;
txtForward.Text = item.ForwardingAddresses != null ? String.Join("; ", item.ForwardingAddresses) : "";
chkDeleteOnForward.Checked = item.DeleteOnForward;
}
开发者ID:jordan49,项目名称:websitepanel,代码行数:12,代码来源:SmarterMail50_EditAccount.ascx.cs
示例7: SaveItem
public void SaveItem(MailAccount item)
{
item.FirstName = txtFirstName.Text;
item.LastName = txtLastName.Text;
item.Signature = txtSignature.Text;
item.ResponderEnabled = chkResponderEnabled.Checked;
item.ReplyTo = txtReplyTo.Text;
item.ResponderSubject = txtSubject.Text;
item.ResponderMessage = txtMessage.Text;
item.ForwardingAddresses = Utils.ParseDelimitedString(txtForward.Text, ';', ' ', ',');
item.DeleteOnForward = chkDeleteOnForward.Checked;
item.ChangePassword = cbChangePassword.Checked;
}
开发者ID:lwhitelock,项目名称:Websitepanel,代码行数:13,代码来源:SmarterMail_EditAccount.ascx.cs
示例8: CreateAccount
public void CreateAccount(MailAccount mailbox)
{
Tree users = AMSHelper.GetUsersConfig();
AmsMailbox accnt = new AmsMailbox(mailbox.Name);
if (accnt.Load(users))
throw new Exception("Mailbox is already registered.");
accnt.Read(mailbox);
if (!accnt.Save(users))
throw new Exception("Couldn't create a mailbox.");
}
开发者ID:lwhitelock,项目名称:Websitepanel,代码行数:13,代码来源:AbilityMailServer.cs
示例9: SaveItem
public void SaveItem(MailAccount item)
{
item.ResponderEnabled = chkResponderEnabled.Checked;
item.ResponderSubject = txtSubject.Text;
item.ResponderMessage = txtMessage.Text;
item.ForwardingAddresses = new string[] { txtForward.Text };
item.RetainLocalCopy = chkOriginalMessage.Checked;
item.FirstName = txtFirstName.Text;
item.LastName = txtLastName.Text;
item.SignatureEnabled = cbSignatureEnabled.Checked;
item.Signature = txtPlainSignature.Text;
item.SignatureHTML = txtHtmlSignature.Text;
}
开发者ID:jordan49,项目名称:websitepanel,代码行数:13,代码来源:hMailServer43_EditAccount.ascx.cs
示例10: BindItem
public void BindItem(MailAccount item)
{
chkResponderEnabled.Checked = item.ResponderEnabled;
txtSubject.Text = item.ResponderSubject;
txtMessage.Text = item.ResponderMessage;
txtForward.Text = item.ForwardingAddresses[0];
chkOriginalMessage.Checked = item.RetainLocalCopy;
txtFirstName.Text = item.FirstName;
txtLastName.Text = item.LastName;
cbSignatureEnabled.Checked = item.SignatureEnabled;
txtPlainSignature.Text = item.Signature;
txtHtmlSignature.Text = item.SignatureHTML;
}
开发者ID:jordan49,项目名称:websitepanel,代码行数:13,代码来源:hMailServer43_EditAccount.ascx.cs
示例11: BindAccounts
private void BindAccounts(MailDomain item, DropDownList ddl, MailAccount[] accounts)
{
if (ddl.Items.Count == 0)
ddl.Items.Add(new ListItem(GetLocalizedString("Text.NotSelected"), ""));
foreach (MailAccount account in accounts)
{
int idx = account.Name.IndexOf("@");
string accountName = account.Name.Substring(0, idx);
string accountDomain = account.Name.Substring(idx + 1);
if (String.Compare(accountDomain, item.Name, true) == 0)
ddl.Items.Add(new ListItem(account.Name, accountName));
}
}
开发者ID:lwhitelock,项目名称:Websitepanel,代码行数:15,代码来源:AbilityMailServer_EditDomain.ascx.cs
示例12: SaveItem
public void SaveItem(MailAccount item)
{
item.Enabled = chkEnabled.Checked;
item.ResponderEnabled = chkResponderEnabled.Checked;
item.ResponderSubject = txtSubject.Text;
item.ResponderMessage = txtMessage.Text;
item.ResponderExpires = chkResponderExpires.Checked;
if (txtResponderExireDate.Text.Trim().Length >= 10) {
item.ResponderExpirationDate = txtResponderExireDate.Text.Trim().Substring(0, 10);}
item.ForwardingEnabled = chkForwardingEnabled.Checked;
if (txtForward.Text.Trim().Length > 0) {
item.ForwardingAddresses = new string[] { txtForward.Text.Trim() };}
item.RetainLocalCopy = chkOriginalMessage.Checked;
item.FirstName = txtFirstName.Text;
item.LastName = txtLastName.Text;
item.SignatureEnabled = cbSignatureEnabled.Checked;
item.Signature = txtPlainSignature.Text;
item.SignatureHTML = txtHtmlSignature.Text;
}
开发者ID:lwhitelock,项目名称:Websitepanel,代码行数:19,代码来源:hMailServer5_EditAccount.ascx.cs
示例13: BindItem
public void BindItem(MailAccount item)
{
txtFullName.Text = item.FullName;
Utils.SelectListItem(ddlAccountType, item.IceWarpAccountType);
Utils.SelectListItem(ddlAccountState, item.IceWarpAccountState);
Utils.SelectListItem(ddlRespondType, item.IceWarpRespondType);
chkRespondOnlyBetweenDates.Checked = item.RespondOnlyBetweenDates;
// Set respond dates to something useful if they are null in IceWarp
if (item.RespondFrom == DateTime.MinValue)
{
item.RespondFrom = DateTime.Today;
}
if (item.RespondTo == DateTime.MinValue)
{
item.RespondTo = DateTime.Today.AddDays(21);
}
calRespondFrom.SelectedDate = item.RespondFrom;
calRespondTo.SelectedDate = item.RespondTo;
chkRespondOnlyBetweenDates_CheckedChanged(this, null);
txtRespondPeriodInDays.Text = item.RespondPeriodInDays.ToString();
txtRespondWithReplyFrom.Text = item.RespondWithReplyFrom;
txtSubject.Text = item.ResponderSubject;
txtMessage.Text = item.ResponderMessage;
txtForward.Text = item.ForwardingAddresses != null ? String.Join("; ", item.ForwardingAddresses) : "";
cbDeleteOnForward.Checked = item.DeleteOnForward;
cbDomainAdmin.Visible = item.IsDomainAdminEnabled;
cbDomainAdmin.Checked = item.IsDomainAdmin;
ddlRespondType_SelectedIndexChanged(this, null);
cbForwardOlder.Checked = item.ForwardOlder;
txtForwardOlderDays.Text = item.ForwardOlderDays.ToString();
txtForwardOlderTo.Text = item.ForwardOlderTo;
cbForwardOlder_CheckedChanged(this, null);
cbDeleteOlder.Checked = item.DeleteOlder;
txtDeleteOlderDays.Text = item.DeleteOlderDays.ToString();
cbDeleteOlder_CheckedChanged(this, null);
}
开发者ID:jonwbstr,项目名称:Websitepanel,代码行数:42,代码来源:IceWarp_EditAccount.ascx.cs
示例14: BindItem
public void BindItem(MailAccount item)
{
chkEnabled.Checked = item.Enabled;
lblSizeInfo.Text = item.Size.ToString() + " MB";
lblQuotaUsedInfo.Text = item.QuotaUsed.ToString() + " %";
lblLastLoginDateInfo.Text = item.LastLogonTime;
chkResponderEnabled.Checked = item.ResponderEnabled;
chkResponderExpires.Checked = item.ResponderExpires;
txtResponderExireDate.Text = item.ResponderExpirationDate;
txtSubject.Text = item.ResponderSubject;
txtMessage.Text = item.ResponderMessage;
chkForwardingEnabled.Checked = item.ForwardingEnabled;
txtForward.Text = item.ForwardingAddresses[0];
chkOriginalMessage.Checked = item.RetainLocalCopy;
txtFirstName.Text = item.FirstName;
txtLastName.Text = item.LastName;
cbSignatureEnabled.Checked = item.SignatureEnabled;
txtPlainSignature.Text = item.Signature;
txtHtmlSignature.Text = item.SignatureHTML;
secStatusInfo.IsCollapsed = false;
}
开发者ID:lwhitelock,项目名称:Websitepanel,代码行数:21,代码来源:hMailServer5_EditAccount.ascx.cs
示例15: CreateAccount
public void CreateAccount(MailAccount mailbox)
{
try
{
svcUserAdmin users = new svcUserAdmin();
PrepareProxy(users);
GenericResult result = users.AddUser(AdminUsername, AdminPassword,
mailbox.Name,
mailbox.Password,
GetDomainName(mailbox.Name),
mailbox.FirstName,
mailbox.LastName,
mailbox.IsDomainAdmin // domain admin is false
);
if (!result.Result)
throw new Exception(result.Message);
// set forwarding settings
result = users.UpdateUserForwardingInfo(AdminUsername, AdminPassword,
mailbox.Name, mailbox.DeleteOnForward,
(mailbox.ForwardingAddresses != null ? String.Join(", ", mailbox.ForwardingAddresses) : ""));
if (!result.Result)
throw new Exception(result.Message);
// set additional settings
result = users.SetRequestedUserSettings(AdminUsername, AdminPassword, mailbox.Name, mailbox.PrepareSetRequestedUserSettingsWebMethodParams());
if (!result.Result)
throw new Exception(result.Message);
// set autoresponder settings
result = users.UpdateUserAutoResponseInfo(AdminUsername, AdminPassword,
mailbox.Name,
mailbox.ResponderEnabled,
(mailbox.ResponderSubject != null ? mailbox.ResponderSubject : ""),
(mailbox.ResponderMessage != null ? mailbox.ResponderMessage : ""));
if (!result.Result)
throw new Exception(result.Message);
}
catch (Exception ex)
{
if (AccountExists(mailbox.Name))
{
DeleteAccount(mailbox.Name);
}
Log.WriteError(ex);
throw new Exception("Could not create mailbox", ex);
}
}
开发者ID:jordan49,项目名称:websitepanel,代码行数:54,代码来源:SmarterMail7.cs
示例16: GetAccount
public MailAccount GetAccount(string mailboxName)
{
try
{
svcUserAdmin users = new svcUserAdmin();
PrepareProxy(users);
UserInfoResult result = users.GetUser(AdminUsername, AdminPassword, mailboxName);
if (!result.Result)
throw new Exception(result.Message);
MailAccount mailbox = new MailAccount();
mailbox.Name = result.UserInfo.UserName;
mailbox.Password = result.UserInfo.Password;
mailbox.FirstName = result.UserInfo.FirstName;
mailbox.LastName = result.UserInfo.LastName;
mailbox.IsDomainAdmin = result.UserInfo.IsDomainAdmin;
mailbox.IsDomainAdminEnabled = EnableDomainAdministrators;
// get additional settings
string[] requestedSettings = new string[]
{
"isenabled",
"maxsize",
"lockpassword",
"replytoaddress",
"signature",
"passwordlocked"
};
SettingsRequestResult addResult = users.GetRequestedUserSettings(AdminUsername, AdminPassword,
mailboxName, requestedSettings);
if (!addResult.Result)
throw new Exception(addResult.Message);
foreach (string pair in addResult.settingValues)
{
string[] parts = pair.Split('=');
if (parts[0] == "isenabled") mailbox.Enabled = Boolean.Parse(parts[1]);
else if (parts[0] == "maxsize") mailbox.MaxMailboxSize = Int32.Parse(parts[1]);
else if (parts[0] == "passwordlocked") mailbox.PasswordLocked = Boolean.Parse(parts[1]);
else if (parts[0] == "replytoaddress") mailbox.ReplyTo = parts[1];
else if (parts[0] == "signature") mailbox.Signature = parts[1];
}
// get forwardings info
UserForwardingInfoResult forwResult = users.GetUserForwardingInfo(AdminUsername, AdminPassword, mailboxName);
if (!forwResult.Result)
throw new Exception(forwResult.Message);
string[] forwAddresses = forwResult.ForwardingAddress.Split(';', ',');
List<string> listForAddresses = new List<string>();
foreach (string forwAddress in forwAddresses)
{
if (!String.IsNullOrEmpty(forwAddress.Trim()))
listForAddresses.Add(forwAddress.Trim());
}
mailbox.ForwardingAddresses = listForAddresses.ToArray();
mailbox.DeleteOnForward = forwResult.DeleteOnForward;
// get autoresponder info
UserAutoResponseResult respResult = users.GetUserAutoResponseInfo(AdminUsername, AdminPassword, mailboxName);
if (!respResult.Result)
throw new Exception(respResult.Message);
mailbox.ResponderEnabled = respResult.Enabled;
mailbox.ResponderSubject = respResult.Subject;
mailbox.ResponderMessage = respResult.Body;
return mailbox;
}
catch (Exception ex)
{
throw new Exception("Could not get mailbox", ex);
}
}
开发者ID:jordan49,项目名称:websitepanel,代码行数:81,代码来源:SmarterMail7.cs
示例17: GetAccounts
public MailAccount[] GetAccounts(string domainName)
{
try
{
svcUserAdmin users = new svcUserAdmin();
PrepareProxy(users);
UserInfoListResult result = users.GetUsers(AdminUsername, AdminPassword, domainName);
if (!result.Result)
throw new Exception(result.Message);
List<MailAccount> accounts = new List<MailAccount>();
foreach (UserInfo user in result.Users)
{
if (user.IsDomainAdmin && !ImportDomainAdmin)
continue;
MailAccount account = new MailAccount();
account.Name = user.UserName;
account.Password = user.Password;
accounts.Add(account);
}
return accounts.ToArray();
}
catch (Exception ex)
{
throw new Exception("Could not get the list of domain mailboxes", ex);
}
}
开发者ID:jordan49,项目名称:websitepanel,代码行数:32,代码来源:SmarterMail7.cs
示例18: AddAutoResponderInfo
private void AddAutoResponderInfo(MailAccount mailbox)
{
TreeNode autoresponses = deliveryConfig.ChildNodes["autoresponses"];
if (autoresponses == null)
{
autoresponses = new TreeNode();
autoresponses.NodeName = "autoresponses";
deliveryConfig.ChildNodes.Add(autoresponses);
}
autoresponses["enabled"] = mailbox.ResponderEnabled ? "1" : "0";
if (mailbox.ResponderEnabled)
{
autoresponses["subject"] = mailbox.ResponderSubject;
autoresponses["body"] = mailbox.ResponderMessage;
if (!string.IsNullOrEmpty(mailbox.ReplyTo))
{
autoresponses["usereplyto"] = "1";
autoresponses["replyto"] = mailbox.ReplyTo;
}
else
{
autoresponses["usereplyto"] = "0";
autoresponses["replyto"] = string.Empty;
}
}
else
{
autoresponses["subject"] = string.Empty;
autoresponses["body"] = string.Empty;
}
}
开发者ID:jordan49,项目名称:websitepanel,代码行数:35,代码来源:AmsMailbox.cs
示例19: Read
public void Read(MailAccount mailbox)
{
userConfig["domain"] = GetDomainName(mailbox.Name);
userConfig["enabled"] = mailbox.Enabled ? "1" : "0";
userConfig["user"] = GetAccountName(mailbox.Name);
userConfig["pass"] = mailbox.Password;
// forwardings
if (mailbox.ForwardingAddresses != null)
AddForwardingInfo(mailbox.ForwardingAddresses, mailbox.DeleteOnForward);
AddAutoResponderInfo(mailbox);
}
开发者ID:jordan49,项目名称:websitepanel,代码行数:12,代码来源:AmsMailbox.cs
示例20: ToMailAccount
public MailAccount ToMailAccount()
{
MailAccount account = new MailAccount();
account.Name = string.Concat(userConfig["user"], "@", userConfig["domain"]);
account.Enabled = userConfig["enabled"] == "1" ? true : false;
account.Password = userConfig["pass"];
// read forwardings
TreeNode redirection = deliveryConfig.ChildNodes["redirection"];
if (redirection != null)
{
TreeNode redirections = redirection.ChildNodes["redirections"];
if (redirections != null)
{
List<string> list = new List<string>();
foreach (TreeNode node in redirections.ChildNodes)
list.Add(node.NodeValue);
account.ForwardingAddresses = list.ToArray();
}
}
// read autoresponder
TreeNode autoresponses = deliveryConfig.ChildNodes["autoresponses"];
if (autoresponses != null)
{
account.ResponderEnabled = autoresponses["enabled"] == "1" ? true : false;
account.ResponderSubject = autoresponses["subject"];
account.ResponderMessage = autoresponses["body"];
if (autoresponses["usereplyto"] == "1")
account.ReplyTo = autoresponses["replyto"];
}
return account;
}
开发者ID:jordan49,项目名称:websitepanel,代码行数:38,代码来源:AmsMailbox.cs
注:本文中的WebsitePanel.Providers.Mail.MailAccount类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论