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


C# Mail.MailAccount类代码示例

本文整理汇总了C#中WebsitePanel.Providers.Mail.MailAccount的典型用法代码示例。如果您正苦于以下问题:C# MailAccount类的具体用法?C# MailAccount怎么用?C# MailAccount使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MailAccount类属于WebsitePanel.Providers.Mail命名空间,在下文中一共展示了MailAccount类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


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