當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。