Click here to Skip to main content
15,891,567 members
Articles / Programming Languages / C#

SMTP and POP3 Mail Server

Rate me:
Please Sign up or sign in to vote.
4.88/5 (96 votes)
29 Sep 20031 min read 1M   18.9K   315  
An SMTP and POP3 mail server written using the .NET Framework and C#.
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Net;
using LumiSoft.MailServer;

namespace MailServerManager.Forms
{
	/// <summary>
	/// Summary description for wfrm_Settings.
	/// </summary>
	public class wfrm_Settings : System.Windows.Forms.Form
	{
		private System.Windows.Forms.GroupBox groupBox4;
		private LumiSoft.UI.Controls.WLabel wLabel10;
		private LumiSoft.UI.Controls.WLabel wLabel9;
		private LumiSoft.UI.Controls.WLabel wLabel11;
		private LumiSoft.UI.Controls.WLabel wLabel8;
		private LumiSoft.UI.Controls.WSpinEdit m_pPOP3SessionIdle;
		private LumiSoft.UI.Controls.WSpinEdit m_pPOP3CommandIdle;
		private LumiSoft.UI.Controls.WLabel wLabel13;
		private LumiSoft.UI.Controls.WSpinEdit m_pMaxPOP3badCmds;
		private System.Windows.Forms.GroupBox groupBox3;
		private LumiSoft.UI.Controls.WLabel wLabel3;
		private LumiSoft.UI.Controls.WLabel wLabel2;
		private LumiSoft.UI.Controls.WLabel wLabel1;
		private LumiSoft.UI.Controls.WSpinEdit m_pMaxSMTPbadCmds;
		private LumiSoft.UI.Controls.WEditBox m_pPostmasterPwd;
		private LumiSoft.UI.Controls.WEditBox m_pPostmasterUName;
		private LumiSoft.UI.Controls.WSpinEdit m_pMaxRecipients;
		private LumiSoft.UI.Controls.WLabel mt_maxrecipients;
		private LumiSoft.UI.Controls.WLabel wLabel6;
		private LumiSoft.UI.Controls.WLabel wLabel4;
		private LumiSoft.UI.Controls.WSpinEdit m_pMessageSize;
		private LumiSoft.UI.Controls.WSpinEdit m_pCommandIdle;
		private LumiSoft.UI.Controls.WSpinEdit m_pSessionIdle;
		private LumiSoft.UI.Controls.WLabel mt_msgsize;
		private LumiSoft.UI.Controls.WLabel mt_commandidle;
		private LumiSoft.UI.Controls.WLabel mt_sessionidle;
		private LumiSoft.UI.Controls.WLabel wLabel5;
		private LumiSoft.UI.Controls.WButton m_pSave;
		private System.Windows.Forms.GroupBox groupBox2;
		private LumiSoft.UI.Controls.WComboBox m_pPOP3IPAddresses;
		private LumiSoft.UI.Controls.WLabel wLabel7;
		private LumiSoft.UI.Controls.WSpinEdit m_pPOP3_Threads;
		private LumiSoft.UI.Controls.WSpinEdit m_pSMTP_Threads;
		private LumiSoft.UI.Controls.WSpinEdit m_pPOP3;
		private LumiSoft.UI.Controls.WSpinEdit m_pSMTP;
		private LumiSoft.UI.Controls.WComboBox m_pSMTPIPAddresses;
		private LumiSoft.UI.Controls.WLabel mt_pop3max;
		private LumiSoft.UI.Controls.WLabel mt_smtpmax;
		private LumiSoft.UI.Controls.WLabel mt_pop3;
		private LumiSoft.UI.Controls.WLabel mt_smtp;
		private LumiSoft.UI.Controls.WLabel mt_ipaddress;
		private System.Windows.Forms.GroupBox groupBox1;
		private LumiSoft.UI.Controls.WLabel wLabel12;
		private LumiSoft.UI.Controls.WEditBox m_pMailStorePath;
		private LumiSoft.UI.Controls.WButton m_pTest;
		private LumiSoft.UI.Controls.WButton m_pConStrBrowse;
		private LumiSoft.UI.Controls.WEditBox m_pConStr;
		private LumiSoft.UI.Controls.WComboBox m_pDbType;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		private DataSet   dsSettings = null;

		public wfrm_Settings()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//

			try
			{
				dsSettings = new DataSet();
				dsSettings.ReadXml(Application.StartupPath + "\\Settings\\Settings.xml");
			
				m_pSMTPIPAddresses.Items.Add("(All Unassigned)");
				m_pPOP3IPAddresses.Items.Add("(All Unassigned)");

				m_pDbType.Items.Add("XML","XML");
				m_pDbType.Items.Add("MSSQL","MSSQL");
				m_pDbType.SelectedIndex = 0;

				IPHostEntry hostInfo = Dns.GetHostByName(Dns.GetHostName());
			
				foreach(IPAddress ip in hostInfo.AddressList){
					string ipStr = ip.ToString();
					m_pSMTPIPAddresses.Items.Add(ipStr);
					m_pPOP3IPAddresses.Items.Add(ipStr);
				}

				RefreshForm();				
			}
			catch(Exception x)
			{
				wfrm_Error frm = new wfrm_Error(x,new System.Diagnostics.StackTrace());
				frm.ShowDialog(this);
			}
		}

		#region function Dispose

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#endregion

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.groupBox4 = new System.Windows.Forms.GroupBox();
			this.wLabel10 = new LumiSoft.UI.Controls.WLabel();
			this.wLabel9 = new LumiSoft.UI.Controls.WLabel();
			this.wLabel11 = new LumiSoft.UI.Controls.WLabel();
			this.wLabel8 = new LumiSoft.UI.Controls.WLabel();
			this.m_pPOP3SessionIdle = new LumiSoft.UI.Controls.WSpinEdit();
			this.m_pPOP3CommandIdle = new LumiSoft.UI.Controls.WSpinEdit();
			this.wLabel13 = new LumiSoft.UI.Controls.WLabel();
			this.m_pMaxPOP3badCmds = new LumiSoft.UI.Controls.WSpinEdit();
			this.groupBox3 = new System.Windows.Forms.GroupBox();
			this.wLabel3 = new LumiSoft.UI.Controls.WLabel();
			this.wLabel2 = new LumiSoft.UI.Controls.WLabel();
			this.wLabel1 = new LumiSoft.UI.Controls.WLabel();
			this.m_pMaxSMTPbadCmds = new LumiSoft.UI.Controls.WSpinEdit();
			this.m_pPostmasterPwd = new LumiSoft.UI.Controls.WEditBox();
			this.m_pPostmasterUName = new LumiSoft.UI.Controls.WEditBox();
			this.m_pMaxRecipients = new LumiSoft.UI.Controls.WSpinEdit();
			this.mt_maxrecipients = new LumiSoft.UI.Controls.WLabel();
			this.wLabel6 = new LumiSoft.UI.Controls.WLabel();
			this.wLabel4 = new LumiSoft.UI.Controls.WLabel();
			this.m_pMessageSize = new LumiSoft.UI.Controls.WSpinEdit();
			this.m_pCommandIdle = new LumiSoft.UI.Controls.WSpinEdit();
			this.m_pSessionIdle = new LumiSoft.UI.Controls.WSpinEdit();
			this.mt_msgsize = new LumiSoft.UI.Controls.WLabel();
			this.mt_commandidle = new LumiSoft.UI.Controls.WLabel();
			this.mt_sessionidle = new LumiSoft.UI.Controls.WLabel();
			this.wLabel5 = new LumiSoft.UI.Controls.WLabel();
			this.m_pSave = new LumiSoft.UI.Controls.WButton();
			this.groupBox2 = new System.Windows.Forms.GroupBox();
			this.m_pPOP3IPAddresses = new LumiSoft.UI.Controls.WComboBox();
			this.wLabel7 = new LumiSoft.UI.Controls.WLabel();
			this.m_pPOP3_Threads = new LumiSoft.UI.Controls.WSpinEdit();
			this.m_pSMTP_Threads = new LumiSoft.UI.Controls.WSpinEdit();
			this.m_pPOP3 = new LumiSoft.UI.Controls.WSpinEdit();
			this.m_pSMTP = new LumiSoft.UI.Controls.WSpinEdit();
			this.m_pSMTPIPAddresses = new LumiSoft.UI.Controls.WComboBox();
			this.mt_pop3max = new LumiSoft.UI.Controls.WLabel();
			this.mt_smtpmax = new LumiSoft.UI.Controls.WLabel();
			this.mt_pop3 = new LumiSoft.UI.Controls.WLabel();
			this.mt_smtp = new LumiSoft.UI.Controls.WLabel();
			this.mt_ipaddress = new LumiSoft.UI.Controls.WLabel();
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.wLabel12 = new LumiSoft.UI.Controls.WLabel();
			this.m_pMailStorePath = new LumiSoft.UI.Controls.WEditBox();
			this.m_pTest = new LumiSoft.UI.Controls.WButton();
			this.m_pConStrBrowse = new LumiSoft.UI.Controls.WButton();
			this.m_pConStr = new LumiSoft.UI.Controls.WEditBox();
			this.m_pDbType = new LumiSoft.UI.Controls.WComboBox();
			this.groupBox4.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.m_pPOP3SessionIdle)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pPOP3CommandIdle)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pMaxPOP3badCmds)).BeginInit();
			this.groupBox3.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.m_pMaxSMTPbadCmds)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pPostmasterPwd)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pPostmasterUName)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pMaxRecipients)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pMessageSize)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pCommandIdle)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pSessionIdle)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pSave)).BeginInit();
			this.groupBox2.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.m_pPOP3IPAddresses)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pPOP3_Threads)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pSMTP_Threads)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pPOP3)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pSMTP)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pSMTPIPAddresses)).BeginInit();
			this.groupBox1.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.m_pMailStorePath)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pTest)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pConStrBrowse)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pConStr)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pDbType)).BeginInit();
			this.SuspendLayout();
			// 
			// groupBox4
			// 
			this.groupBox4.Controls.AddRange(new System.Windows.Forms.Control[] {
																					this.wLabel10,
																					this.wLabel9,
																					this.wLabel11,
																					this.wLabel8,
																					this.m_pPOP3SessionIdle,
																					this.m_pPOP3CommandIdle,
																					this.wLabel13,
																					this.m_pMaxPOP3badCmds});
			this.groupBox4.Location = new System.Drawing.Point(14, 318);
			this.groupBox4.Name = "groupBox4";
			this.groupBox4.Size = new System.Drawing.Size(600, 72);
			this.groupBox4.TabIndex = 21;
			this.groupBox4.TabStop = false;
			this.groupBox4.Text = "POP3";
			// 
			// wLabel10
			// 
			this.wLabel10.Location = new System.Drawing.Point(16, 16);
			this.wLabel10.Name = "wLabel10";
			this.wLabel10.TabIndex = 17;
			this.wLabel10.Text = "Session Idle Timeout";
			this.wLabel10.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			// 
			// wLabel10.ViewStyle
			// 
			// 
			// wLabel9
			// 
			this.wLabel9.Location = new System.Drawing.Point(304, 16);
			this.wLabel9.Name = "wLabel9";
			this.wLabel9.TabIndex = 18;
			this.wLabel9.Text = "Command Idle Timeout";
			this.wLabel9.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			// 
			// wLabel9.ViewStyle
			// 
			// 
			// wLabel11
			// 
			this.wLabel11.Location = new System.Drawing.Point(520, 16);
			this.wLabel11.Name = "wLabel11";
			this.wLabel11.Size = new System.Drawing.Size(48, 24);
			this.wLabel11.TabIndex = 22;
			this.wLabel11.Text = "sec.";
			this.wLabel11.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
			// 
			// wLabel11.ViewStyle
			// 
			// 
			// wLabel8
			// 
			this.wLabel8.Location = new System.Drawing.Point(232, 16);
			this.wLabel8.Name = "wLabel8";
			this.wLabel8.Size = new System.Drawing.Size(48, 24);
			this.wLabel8.TabIndex = 21;
			this.wLabel8.Text = "sec.";
			this.wLabel8.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
			// 
			// wLabel8.ViewStyle
			// 
			// 
			// m_pPOP3SessionIdle
			// 
			this.m_pPOP3SessionIdle.BackColor = System.Drawing.Color.White;
			this.m_pPOP3SessionIdle.ButtonsAlign = LumiSoft.UI.Controls.LeftRight.Right;
			this.m_pPOP3SessionIdle.DecimalPlaces = 0;
			this.m_pPOP3SessionIdle.DecMaxValue = new System.Decimal(new int[] {
																				   999999999,
																				   0,
																				   0,
																				   0});
			this.m_pPOP3SessionIdle.DecMinValue = new System.Decimal(new int[] {
																				   20,
																				   0,
																				   0,
																				   0});
			this.m_pPOP3SessionIdle.DecValue = new System.Decimal(new int[] {
																				60,
																				0,
																				0,
																				0});
			this.m_pPOP3SessionIdle.Location = new System.Drawing.Point(168, 16);
			this.m_pPOP3SessionIdle.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Numeric;
			this.m_pPOP3SessionIdle.MaxLength = 32767;
			this.m_pPOP3SessionIdle.Name = "m_pPOP3SessionIdle";
			this.m_pPOP3SessionIdle.ReadOnly = false;
			this.m_pPOP3SessionIdle.Size = new System.Drawing.Size(64, 20);
			this.m_pPOP3SessionIdle.TabIndex = 19;
			this.m_pPOP3SessionIdle.Text = "60";
			this.m_pPOP3SessionIdle.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
			this.m_pPOP3SessionIdle.UseStaticViewStyle = true;
			// 
			// m_pPOP3SessionIdle.ViewStyle
			// 
			// 
			// m_pPOP3CommandIdle
			// 
			this.m_pPOP3CommandIdle.BackColor = System.Drawing.Color.White;
			this.m_pPOP3CommandIdle.ButtonsAlign = LumiSoft.UI.Controls.LeftRight.Right;
			this.m_pPOP3CommandIdle.DecimalPlaces = 0;
			this.m_pPOP3CommandIdle.DecMaxValue = new System.Decimal(new int[] {
																				   999999999,
																				   0,
																				   0,
																				   0});
			this.m_pPOP3CommandIdle.DecMinValue = new System.Decimal(new int[] {
																				   10,
																				   0,
																				   0,
																				   0});
			this.m_pPOP3CommandIdle.DecValue = new System.Decimal(new int[] {
																				60,
																				0,
																				0,
																				0});
			this.m_pPOP3CommandIdle.Location = new System.Drawing.Point(456, 16);
			this.m_pPOP3CommandIdle.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Numeric;
			this.m_pPOP3CommandIdle.MaxLength = 32767;
			this.m_pPOP3CommandIdle.Name = "m_pPOP3CommandIdle";
			this.m_pPOP3CommandIdle.ReadOnly = false;
			this.m_pPOP3CommandIdle.Size = new System.Drawing.Size(64, 20);
			this.m_pPOP3CommandIdle.TabIndex = 20;
			this.m_pPOP3CommandIdle.Text = "60";
			this.m_pPOP3CommandIdle.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
			this.m_pPOP3CommandIdle.UseStaticViewStyle = true;
			// 
			// m_pPOP3CommandIdle.ViewStyle
			// 
			// 
			// wLabel13
			// 
			this.wLabel13.Location = new System.Drawing.Point(296, 40);
			this.wLabel13.Name = "wLabel13";
			this.wLabel13.Size = new System.Drawing.Size(158, 24);
			this.wLabel13.TabIndex = 27;
			this.wLabel13.Text = "Max. bad commands";
			this.wLabel13.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			// 
			// wLabel13.ViewStyle
			// 
			// 
			// m_pMaxPOP3badCmds
			// 
			this.m_pMaxPOP3badCmds.BackColor = System.Drawing.Color.White;
			this.m_pMaxPOP3badCmds.ButtonsAlign = LumiSoft.UI.Controls.LeftRight.Right;
			this.m_pMaxPOP3badCmds.DecimalPlaces = 0;
			this.m_pMaxPOP3badCmds.DecMaxValue = new System.Decimal(new int[] {
																				  999999999,
																				  0,
																				  0,
																				  0});
			this.m_pMaxPOP3badCmds.DecMinValue = new System.Decimal(new int[] {
																				  1,
																				  0,
																				  0,
																				  0});
			this.m_pMaxPOP3badCmds.DecValue = new System.Decimal(new int[] {
																			   8,
																			   0,
																			   0,
																			   0});
			this.m_pMaxPOP3badCmds.Location = new System.Drawing.Point(456, 40);
			this.m_pMaxPOP3badCmds.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Numeric;
			this.m_pMaxPOP3badCmds.MaxLength = 32767;
			this.m_pMaxPOP3badCmds.Name = "m_pMaxPOP3badCmds";
			this.m_pMaxPOP3badCmds.ReadOnly = false;
			this.m_pMaxPOP3badCmds.Size = new System.Drawing.Size(64, 20);
			this.m_pMaxPOP3badCmds.TabIndex = 26;
			this.m_pMaxPOP3badCmds.Text = "8";
			this.m_pMaxPOP3badCmds.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
			this.m_pMaxPOP3badCmds.UseStaticViewStyle = true;
			// 
			// m_pMaxPOP3badCmds.ViewStyle
			// 
			// 
			// groupBox3
			// 
			this.groupBox3.Controls.AddRange(new System.Windows.Forms.Control[] {
																					this.wLabel3,
																					this.wLabel2,
																					this.wLabel1,
																					this.m_pMaxSMTPbadCmds,
																					this.m_pPostmasterPwd,
																					this.m_pPostmasterUName,
																					this.m_pMaxRecipients,
																					this.mt_maxrecipients,
																					this.wLabel6,
																					this.wLabel4,
																					this.m_pMessageSize,
																					this.m_pCommandIdle,
																					this.m_pSessionIdle,
																					this.mt_msgsize,
																					this.mt_commandidle,
																					this.mt_sessionidle,
																					this.wLabel5});
			this.groupBox3.Location = new System.Drawing.Point(14, 190);
			this.groupBox3.Name = "groupBox3";
			this.groupBox3.Size = new System.Drawing.Size(600, 120);
			this.groupBox3.TabIndex = 20;
			this.groupBox3.TabStop = false;
			this.groupBox3.Text = "SMTP";
			// 
			// wLabel3
			// 
			this.wLabel3.Location = new System.Drawing.Point(16, 88);
			this.wLabel3.Name = "wLabel3";
			this.wLabel3.TabIndex = 25;
			this.wLabel3.Text = "Postmaster Password";
			this.wLabel3.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			// 
			// wLabel3.ViewStyle
			// 
			// 
			// wLabel2
			// 
			this.wLabel2.Location = new System.Drawing.Point(16, 64);
			this.wLabel2.Name = "wLabel2";
			this.wLabel2.TabIndex = 24;
			this.wLabel2.Text = "Postmaster UserName";
			this.wLabel2.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			// 
			// wLabel2.ViewStyle
			// 
			// 
			// wLabel1
			// 
			this.wLabel1.Location = new System.Drawing.Point(296, 64);
			this.wLabel1.Name = "wLabel1";
			this.wLabel1.Size = new System.Drawing.Size(158, 24);
			this.wLabel1.TabIndex = 23;
			this.wLabel1.Text = "Max. bad commands";
			this.wLabel1.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			// 
			// wLabel1.ViewStyle
			// 
			// 
			// m_pMaxSMTPbadCmds
			// 
			this.m_pMaxSMTPbadCmds.BackColor = System.Drawing.Color.White;
			this.m_pMaxSMTPbadCmds.ButtonsAlign = LumiSoft.UI.Controls.LeftRight.Right;
			this.m_pMaxSMTPbadCmds.DecimalPlaces = 0;
			this.m_pMaxSMTPbadCmds.DecMaxValue = new System.Decimal(new int[] {
																				  999999999,
																				  0,
																				  0,
																				  0});
			this.m_pMaxSMTPbadCmds.DecMinValue = new System.Decimal(new int[] {
																				  1,
																				  0,
																				  0,
																				  0});
			this.m_pMaxSMTPbadCmds.DecValue = new System.Decimal(new int[] {
																			   8,
																			   0,
																			   0,
																			   0});
			this.m_pMaxSMTPbadCmds.Location = new System.Drawing.Point(456, 64);
			this.m_pMaxSMTPbadCmds.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Numeric;
			this.m_pMaxSMTPbadCmds.MaxLength = 32767;
			this.m_pMaxSMTPbadCmds.Name = "m_pMaxSMTPbadCmds";
			this.m_pMaxSMTPbadCmds.ReadOnly = false;
			this.m_pMaxSMTPbadCmds.Size = new System.Drawing.Size(64, 20);
			this.m_pMaxSMTPbadCmds.TabIndex = 22;
			this.m_pMaxSMTPbadCmds.Text = "8";
			this.m_pMaxSMTPbadCmds.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
			this.m_pMaxSMTPbadCmds.UseStaticViewStyle = true;
			// 
			// m_pMaxSMTPbadCmds.ViewStyle
			// 
			// 
			// m_pPostmasterPwd
			// 
			this.m_pPostmasterPwd.Location = new System.Drawing.Point(168, 88);
			this.m_pPostmasterPwd.Name = "m_pPostmasterPwd";
			this.m_pPostmasterPwd.Size = new System.Drawing.Size(104, 20);
			this.m_pPostmasterPwd.TabIndex = 21;
			// 
			// m_pPostmasterPwd.ViewStyle
			// 
			this.m_pPostmasterPwd.ViewStyle.EditReadOnlyColor = System.Drawing.Color.White;
			// 
			// m_pPostmasterUName
			// 
			this.m_pPostmasterUName.Location = new System.Drawing.Point(168, 64);
			this.m_pPostmasterUName.Name = "m_pPostmasterUName";
			this.m_pPostmasterUName.Size = new System.Drawing.Size(104, 20);
			this.m_pPostmasterUName.TabIndex = 20;
			// 
			// m_pPostmasterUName.ViewStyle
			// 
			this.m_pPostmasterUName.ViewStyle.EditReadOnlyColor = System.Drawing.Color.White;
			// 
			// m_pMaxRecipients
			// 
			this.m_pMaxRecipients.BackColor = System.Drawing.Color.White;
			this.m_pMaxRecipients.ButtonsAlign = LumiSoft.UI.Controls.LeftRight.Right;
			this.m_pMaxRecipients.DecimalPlaces = 0;
			this.m_pMaxRecipients.DecMaxValue = new System.Decimal(new int[] {
																				 999999999,
																				 0,
																				 0,
																				 0});
			this.m_pMaxRecipients.DecMinValue = new System.Decimal(new int[] {
																				 1,
																				 0,
																				 0,
																				 0});
			this.m_pMaxRecipients.DecValue = new System.Decimal(new int[] {
																			  100,
																			  0,
																			  0,
																			  0});
			this.m_pMaxRecipients.Location = new System.Drawing.Point(456, 40);
			this.m_pMaxRecipients.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Numeric;
			this.m_pMaxRecipients.MaxLength = 32767;
			this.m_pMaxRecipients.Name = "m_pMaxRecipients";
			this.m_pMaxRecipients.ReadOnly = false;
			this.m_pMaxRecipients.Size = new System.Drawing.Size(64, 20);
			this.m_pMaxRecipients.TabIndex = 19;
			this.m_pMaxRecipients.Text = "100";
			this.m_pMaxRecipients.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
			this.m_pMaxRecipients.UseStaticViewStyle = true;
			// 
			// m_pMaxRecipients.ViewStyle
			// 
			// 
			// mt_maxrecipients
			// 
			this.mt_maxrecipients.Location = new System.Drawing.Point(296, 40);
			this.mt_maxrecipients.Name = "mt_maxrecipients";
			this.mt_maxrecipients.Size = new System.Drawing.Size(158, 24);
			this.mt_maxrecipients.TabIndex = 18;
			this.mt_maxrecipients.Text = "Max. Recipients per Message";
			this.mt_maxrecipients.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			// 
			// mt_maxrecipients.ViewStyle
			// 
			// 
			// wLabel6
			// 
			this.wLabel6.Location = new System.Drawing.Point(520, 16);
			this.wLabel6.Name = "wLabel6";
			this.wLabel6.Size = new System.Drawing.Size(48, 24);
			this.wLabel6.TabIndex = 17;
			this.wLabel6.Text = "MB";
			this.wLabel6.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
			// 
			// wLabel6.ViewStyle
			// 
			// 
			// wLabel4
			// 
			this.wLabel4.Location = new System.Drawing.Point(232, 16);
			this.wLabel4.Name = "wLabel4";
			this.wLabel4.Size = new System.Drawing.Size(48, 24);
			this.wLabel4.TabIndex = 6;
			this.wLabel4.Text = "sec.";
			this.wLabel4.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
			// 
			// wLabel4.ViewStyle
			// 
			// 
			// m_pMessageSize
			// 
			this.m_pMessageSize.BackColor = System.Drawing.Color.White;
			this.m_pMessageSize.ButtonsAlign = LumiSoft.UI.Controls.LeftRight.Right;
			this.m_pMessageSize.DecimalPlaces = 0;
			this.m_pMessageSize.DecMaxValue = new System.Decimal(new int[] {
																			   999999999,
																			   0,
																			   0,
																			   0});
			this.m_pMessageSize.DecMinValue = new System.Decimal(new int[] {
																			   1,
																			   0,
																			   0,
																			   0});
			this.m_pMessageSize.DecValue = new System.Decimal(new int[] {
																			10,
																			0,
																			0,
																			0});
			this.m_pMessageSize.Location = new System.Drawing.Point(456, 16);
			this.m_pMessageSize.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Numeric;
			this.m_pMessageSize.MaxLength = 32767;
			this.m_pMessageSize.Name = "m_pMessageSize";
			this.m_pMessageSize.ReadOnly = false;
			this.m_pMessageSize.Size = new System.Drawing.Size(64, 20);
			this.m_pMessageSize.TabIndex = 5;
			this.m_pMessageSize.Text = "10";
			this.m_pMessageSize.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
			this.m_pMessageSize.UseStaticViewStyle = true;
			// 
			// m_pMessageSize.ViewStyle
			// 
			// 
			// m_pCommandIdle
			// 
			this.m_pCommandIdle.BackColor = System.Drawing.Color.White;
			this.m_pCommandIdle.ButtonsAlign = LumiSoft.UI.Controls.LeftRight.Right;
			this.m_pCommandIdle.DecimalPlaces = 0;
			this.m_pCommandIdle.DecMaxValue = new System.Decimal(new int[] {
																			   999999999,
																			   0,
																			   0,
																			   0});
			this.m_pCommandIdle.DecMinValue = new System.Decimal(new int[] {
																			   10,
																			   0,
																			   0,
																			   0});
			this.m_pCommandIdle.DecValue = new System.Decimal(new int[] {
																			60,
																			0,
																			0,
																			0});
			this.m_pCommandIdle.Location = new System.Drawing.Point(168, 40);
			this.m_pCommandIdle.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Numeric;
			this.m_pCommandIdle.MaxLength = 32767;
			this.m_pCommandIdle.Name = "m_pCommandIdle";
			this.m_pCommandIdle.ReadOnly = false;
			this.m_pCommandIdle.Size = new System.Drawing.Size(64, 20);
			this.m_pCommandIdle.TabIndex = 4;
			this.m_pCommandIdle.Text = "60";
			this.m_pCommandIdle.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
			this.m_pCommandIdle.UseStaticViewStyle = true;
			// 
			// m_pCommandIdle.ViewStyle
			// 
			// 
			// m_pSessionIdle
			// 
			this.m_pSessionIdle.BackColor = System.Drawing.Color.White;
			this.m_pSessionIdle.ButtonsAlign = LumiSoft.UI.Controls.LeftRight.Right;
			this.m_pSessionIdle.DecimalPlaces = 0;
			this.m_pSessionIdle.DecMaxValue = new System.Decimal(new int[] {
																			   999999999,
																			   0,
																			   0,
																			   0});
			this.m_pSessionIdle.DecMinValue = new System.Decimal(new int[] {
																			   20,
																			   0,
																			   0,
																			   0});
			this.m_pSessionIdle.DecValue = new System.Decimal(new int[] {
																			60,
																			0,
																			0,
																			0});
			this.m_pSessionIdle.Location = new System.Drawing.Point(168, 16);
			this.m_pSessionIdle.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Numeric;
			this.m_pSessionIdle.MaxLength = 32767;
			this.m_pSessionIdle.Name = "m_pSessionIdle";
			this.m_pSessionIdle.ReadOnly = false;
			this.m_pSessionIdle.Size = new System.Drawing.Size(64, 20);
			this.m_pSessionIdle.TabIndex = 3;
			this.m_pSessionIdle.Text = "60";
			this.m_pSessionIdle.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
			this.m_pSessionIdle.UseStaticViewStyle = true;
			// 
			// m_pSessionIdle.ViewStyle
			// 
			// 
			// mt_msgsize
			// 
			this.mt_msgsize.Location = new System.Drawing.Point(296, 16);
			this.mt_msgsize.Name = "mt_msgsize";
			this.mt_msgsize.Size = new System.Drawing.Size(158, 24);
			this.mt_msgsize.TabIndex = 2;
			this.mt_msgsize.Text = "Max. Message Size";
			this.mt_msgsize.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			// 
			// mt_msgsize.ViewStyle
			// 
			// 
			// mt_commandidle
			// 
			this.mt_commandidle.Location = new System.Drawing.Point(16, 40);
			this.mt_commandidle.Name = "mt_commandidle";
			this.mt_commandidle.TabIndex = 1;
			this.mt_commandidle.Text = "Command Idle Timeout";
			this.mt_commandidle.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			// 
			// mt_commandidle.ViewStyle
			// 
			// 
			// mt_sessionidle
			// 
			this.mt_sessionidle.Location = new System.Drawing.Point(16, 16);
			this.mt_sessionidle.Name = "mt_sessionidle";
			this.mt_sessionidle.TabIndex = 0;
			this.mt_sessionidle.Text = "Session Idle Timeout";
			this.mt_sessionidle.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			// 
			// mt_sessionidle.ViewStyle
			// 
			// 
			// wLabel5
			// 
			this.wLabel5.Location = new System.Drawing.Point(232, 40);
			this.wLabel5.Name = "wLabel5";
			this.wLabel5.Size = new System.Drawing.Size(48, 24);
			this.wLabel5.TabIndex = 16;
			this.wLabel5.Text = "sec.";
			this.wLabel5.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
			// 
			// wLabel5.ViewStyle
			// 
			// 
			// m_pSave
			// 
			this.m_pSave.Location = new System.Drawing.Point(534, 14);
			this.m_pSave.Name = "m_pSave";
			this.m_pSave.Size = new System.Drawing.Size(64, 24);
			this.m_pSave.TabIndex = 19;
			this.m_pSave.Text = "Save";
			this.m_pSave.UseStaticViewStyle = true;
			// 
			// m_pSave.ViewStyle
			// 
			// 
			// groupBox2
			// 
			this.groupBox2.Controls.AddRange(new System.Windows.Forms.Control[] {
																					this.m_pPOP3IPAddresses,
																					this.wLabel7,
																					this.m_pPOP3_Threads,
																					this.m_pSMTP_Threads,
																					this.m_pPOP3,
																					this.m_pSMTP,
																					this.m_pSMTPIPAddresses,
																					this.mt_pop3max,
																					this.mt_smtpmax,
																					this.mt_pop3,
																					this.mt_smtp,
																					this.mt_ipaddress});
			this.groupBox2.Location = new System.Drawing.Point(14, 86);
			this.groupBox2.Name = "groupBox2";
			this.groupBox2.Size = new System.Drawing.Size(600, 96);
			this.groupBox2.TabIndex = 18;
			this.groupBox2.TabStop = false;
			this.groupBox2.Text = "TCP/IP";
			// 
			// m_pPOP3IPAddresses
			// 
			this.m_pPOP3IPAddresses.DropDownWidth = 128;
			this.m_pPOP3IPAddresses.Location = new System.Drawing.Point(456, 16);
			this.m_pPOP3IPAddresses.Name = "m_pPOP3IPAddresses";
			this.m_pPOP3IPAddresses.ReadOnly = true;
			this.m_pPOP3IPAddresses.SelectedIndex = -1;
			this.m_pPOP3IPAddresses.Size = new System.Drawing.Size(128, 20);
			this.m_pPOP3IPAddresses.TabIndex = 21;
			this.m_pPOP3IPAddresses.UseStaticViewStyle = true;
			// 
			// m_pPOP3IPAddresses.ViewStyle
			// 
			this.m_pPOP3IPAddresses.VisibleItems = 5;
			// 
			// wLabel7
			// 
			this.wLabel7.Location = new System.Drawing.Point(328, 16);
			this.wLabel7.Name = "wLabel7";
			this.wLabel7.Size = new System.Drawing.Size(126, 24);
			this.wLabel7.TabIndex = 20;
			this.wLabel7.Text = "POP3 IP Address";
			this.wLabel7.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			// 
			// wLabel7.ViewStyle
			// 
			// 
			// m_pPOP3_Threads
			// 
			this.m_pPOP3_Threads.BackColor = System.Drawing.Color.White;
			this.m_pPOP3_Threads.ButtonsAlign = LumiSoft.UI.Controls.LeftRight.Right;
			this.m_pPOP3_Threads.DecimalPlaces = 0;
			this.m_pPOP3_Threads.DecMaxValue = new System.Decimal(new int[] {
																				999,
																				0,
																				0,
																				0});
			this.m_pPOP3_Threads.DecMinValue = new System.Decimal(new int[] {
																				1,
																				0,
																				0,
																				0});
			this.m_pPOP3_Threads.DecValue = new System.Decimal(new int[] {
																			 10,
																			 0,
																			 0,
																			 0});
			this.m_pPOP3_Threads.Location = new System.Drawing.Point(520, 64);
			this.m_pPOP3_Threads.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Numeric;
			this.m_pPOP3_Threads.MaxLength = 32767;
			this.m_pPOP3_Threads.Name = "m_pPOP3_Threads";
			this.m_pPOP3_Threads.ReadOnly = false;
			this.m_pPOP3_Threads.Size = new System.Drawing.Size(64, 20);
			this.m_pPOP3_Threads.TabIndex = 19;
			this.m_pPOP3_Threads.Text = "10";
			this.m_pPOP3_Threads.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
			this.m_pPOP3_Threads.UseStaticViewStyle = true;
			// 
			// m_pPOP3_Threads.ViewStyle
			// 
			// 
			// m_pSMTP_Threads
			// 
			this.m_pSMTP_Threads.BackColor = System.Drawing.Color.White;
			this.m_pSMTP_Threads.ButtonsAlign = LumiSoft.UI.Controls.LeftRight.Right;
			this.m_pSMTP_Threads.DecimalPlaces = 0;
			this.m_pSMTP_Threads.DecMaxValue = new System.Decimal(new int[] {
																				999,
																				0,
																				0,
																				0});
			this.m_pSMTP_Threads.DecMinValue = new System.Decimal(new int[] {
																				1,
																				0,
																				0,
																				0});
			this.m_pSMTP_Threads.DecValue = new System.Decimal(new int[] {
																			 10,
																			 0,
																			 0,
																			 0});
			this.m_pSMTP_Threads.Location = new System.Drawing.Point(208, 64);
			this.m_pSMTP_Threads.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Numeric;
			this.m_pSMTP_Threads.MaxLength = 32767;
			this.m_pSMTP_Threads.Name = "m_pSMTP_Threads";
			this.m_pSMTP_Threads.ReadOnly = false;
			this.m_pSMTP_Threads.Size = new System.Drawing.Size(64, 20);
			this.m_pSMTP_Threads.TabIndex = 18;
			this.m_pSMTP_Threads.Text = "10";
			this.m_pSMTP_Threads.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
			this.m_pSMTP_Threads.UseStaticViewStyle = true;
			// 
			// m_pSMTP_Threads.ViewStyle
			// 
			// 
			// m_pPOP3
			// 
			this.m_pPOP3.BackColor = System.Drawing.Color.White;
			this.m_pPOP3.ButtonsAlign = LumiSoft.UI.Controls.LeftRight.Right;
			this.m_pPOP3.DecimalPlaces = 0;
			this.m_pPOP3.DecMaxValue = new System.Decimal(new int[] {
																		999999999,
																		0,
																		0,
																		0});
			this.m_pPOP3.DecMinValue = new System.Decimal(new int[] {
																		0,
																		0,
																		0,
																		0});
			this.m_pPOP3.DecValue = new System.Decimal(new int[] {
																	 110,
																	 0,
																	 0,
																	 0});
			this.m_pPOP3.Location = new System.Drawing.Point(520, 40);
			this.m_pPOP3.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Numeric;
			this.m_pPOP3.MaxLength = 32767;
			this.m_pPOP3.Name = "m_pPOP3";
			this.m_pPOP3.ReadOnly = false;
			this.m_pPOP3.Size = new System.Drawing.Size(64, 20);
			this.m_pPOP3.TabIndex = 17;
			this.m_pPOP3.Text = "110";
			this.m_pPOP3.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
			this.m_pPOP3.UseStaticViewStyle = true;
			// 
			// m_pPOP3.ViewStyle
			// 
			// 
			// m_pSMTP
			// 
			this.m_pSMTP.BackColor = System.Drawing.Color.White;
			this.m_pSMTP.ButtonsAlign = LumiSoft.UI.Controls.LeftRight.Right;
			this.m_pSMTP.DecimalPlaces = 0;
			this.m_pSMTP.DecMaxValue = new System.Decimal(new int[] {
																		999999999,
																		0,
																		0,
																		0});
			this.m_pSMTP.DecMinValue = new System.Decimal(new int[] {
																		0,
																		0,
																		0,
																		0});
			this.m_pSMTP.DecValue = new System.Decimal(new int[] {
																	 25,
																	 0,
																	 0,
																	 0});
			this.m_pSMTP.Location = new System.Drawing.Point(208, 40);
			this.m_pSMTP.Mask = LumiSoft.UI.Controls.WEditBox_Mask.Numeric;
			this.m_pSMTP.MaxLength = 32767;
			this.m_pSMTP.Name = "m_pSMTP";
			this.m_pSMTP.ReadOnly = false;
			this.m_pSMTP.Size = new System.Drawing.Size(64, 20);
			this.m_pSMTP.TabIndex = 16;
			this.m_pSMTP.Text = "25";
			this.m_pSMTP.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
			this.m_pSMTP.UseStaticViewStyle = true;
			// 
			// m_pSMTP.ViewStyle
			// 
			// 
			// m_pSMTPIPAddresses
			// 
			this.m_pSMTPIPAddresses.DropDownWidth = 128;
			this.m_pSMTPIPAddresses.Location = new System.Drawing.Point(144, 16);
			this.m_pSMTPIPAddresses.Name = "m_pSMTPIPAddresses";
			this.m_pSMTPIPAddresses.ReadOnly = true;
			this.m_pSMTPIPAddresses.SelectedIndex = -1;
			this.m_pSMTPIPAddresses.Size = new System.Drawing.Size(128, 20);
			this.m_pSMTPIPAddresses.TabIndex = 15;
			this.m_pSMTPIPAddresses.UseStaticViewStyle = true;
			// 
			// m_pSMTPIPAddresses.ViewStyle
			// 
			this.m_pSMTPIPAddresses.VisibleItems = 5;
			// 
			// mt_pop3max
			// 
			this.mt_pop3max.Location = new System.Drawing.Point(328, 64);
			this.mt_pop3max.Name = "mt_pop3max";
			this.mt_pop3max.Size = new System.Drawing.Size(190, 24);
			this.mt_pop3max.TabIndex = 14;
			this.mt_pop3max.Text = "Maximum POP3 Threads";
			this.mt_pop3max.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			// 
			// mt_pop3max.ViewStyle
			// 
			// 
			// mt_smtpmax
			// 
			this.mt_smtpmax.Location = new System.Drawing.Point(16, 64);
			this.mt_smtpmax.Name = "mt_smtpmax";
			this.mt_smtpmax.Size = new System.Drawing.Size(190, 24);
			this.mt_smtpmax.TabIndex = 13;
			this.mt_smtpmax.Text = "Maximum SMTP Threads";
			this.mt_smtpmax.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			// 
			// mt_smtpmax.ViewStyle
			// 
			// 
			// mt_pop3
			// 
			this.mt_pop3.Location = new System.Drawing.Point(328, 40);
			this.mt_pop3.Name = "mt_pop3";
			this.mt_pop3.Size = new System.Drawing.Size(190, 24);
			this.mt_pop3.TabIndex = 12;
			this.mt_pop3.Text = "POP3 Port on IP Address Above";
			this.mt_pop3.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			// 
			// mt_pop3.ViewStyle
			// 
			// 
			// mt_smtp
			// 
			this.mt_smtp.Location = new System.Drawing.Point(16, 40);
			this.mt_smtp.Name = "mt_smtp";
			this.mt_smtp.Size = new System.Drawing.Size(190, 24);
			this.mt_smtp.TabIndex = 11;
			this.mt_smtp.Text = "SMTP Port on IP Address Above";
			this.mt_smtp.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			// 
			// mt_smtp.ViewStyle
			// 
			// 
			// mt_ipaddress
			// 
			this.mt_ipaddress.Location = new System.Drawing.Point(16, 16);
			this.mt_ipaddress.Name = "mt_ipaddress";
			this.mt_ipaddress.Size = new System.Drawing.Size(126, 24);
			this.mt_ipaddress.TabIndex = 10;
			this.mt_ipaddress.Text = "SMTP IP Address";
			this.mt_ipaddress.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
			// 
			// mt_ipaddress.ViewStyle
			// 
			// 
			// groupBox1
			// 
			this.groupBox1.Controls.AddRange(new System.Windows.Forms.Control[] {
																					this.wLabel12,
																					this.m_pMailStorePath,
																					this.m_pTest,
																					this.m_pConStrBrowse,
																					this.m_pConStr,
																					this.m_pDbType});
			this.groupBox1.Location = new System.Drawing.Point(14, 6);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(496, 72);
			this.groupBox1.TabIndex = 17;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "Storage";
			// 
			// wLabel12
			// 
			this.wLabel12.Location = new System.Drawing.Point(8, 40);
			this.wLabel12.Name = "wLabel12";
			this.wLabel12.Size = new System.Drawing.Size(88, 24);
			this.wLabel12.TabIndex = 22;
			this.wLabel12.Text = "MailStore Path";
			this.wLabel12.UseStaticViewStyle = false;
			// 
			// wLabel12.ViewStyle
			// 
			// 
			// m_pMailStorePath
			// 
			this.m_pMailStorePath.Location = new System.Drawing.Point(104, 40);
			this.m_pMailStorePath.Name = "m_pMailStorePath";
			this.m_pMailStorePath.Size = new System.Drawing.Size(328, 20);
			this.m_pMailStorePath.TabIndex = 21;
			// 
			// m_pMailStorePath.ViewStyle
			// 
			this.m_pMailStorePath.ViewStyle.EditReadOnlyColor = System.Drawing.Color.White;
			// 
			// m_pTest
			// 
			this.m_pTest.Enabled = false;
			this.m_pTest.Location = new System.Drawing.Point(440, 16);
			this.m_pTest.Name = "m_pTest";
			this.m_pTest.Size = new System.Drawing.Size(40, 20);
			this.m_pTest.TabIndex = 20;
			this.m_pTest.Text = "Test";
			this.m_pTest.UseStaticViewStyle = true;
			// 
			// m_pTest.ViewStyle
			// 
			// 
			// m_pConStrBrowse
			// 
			this.m_pConStrBrowse.Enabled = false;
			this.m_pConStrBrowse.Location = new System.Drawing.Point(448, 40);
			this.m_pConStrBrowse.Name = "m_pConStrBrowse";
			this.m_pConStrBrowse.Size = new System.Drawing.Size(24, 20);
			this.m_pConStrBrowse.TabIndex = 19;
			this.m_pConStrBrowse.Text = "...";
			this.m_pConStrBrowse.UseStaticViewStyle = true;
			// 
			// m_pConStrBrowse.ViewStyle
			// 
			// 
			// m_pConStr
			// 
			this.m_pConStr.Location = new System.Drawing.Point(104, 16);
			this.m_pConStr.Name = "m_pConStr";
			this.m_pConStr.Size = new System.Drawing.Size(328, 20);
			this.m_pConStr.TabIndex = 17;
			this.m_pConStr.UseStaticViewStyle = true;
			// 
			// m_pConStr.ViewStyle
			// 
			// 
			// m_pDbType
			// 
			this.m_pDbType.DropDownWidth = 88;
			this.m_pDbType.Location = new System.Drawing.Point(8, 16);
			this.m_pDbType.Name = "m_pDbType";
			this.m_pDbType.ReadOnly = true;
			this.m_pDbType.SelectedIndex = -1;
			this.m_pDbType.Size = new System.Drawing.Size(88, 20);
			this.m_pDbType.TabIndex = 17;
			this.m_pDbType.UseStaticViewStyle = true;
			// 
			// m_pDbType.ViewStyle
			// 
			this.m_pDbType.VisibleItems = 10;
			// 
			// wfrm_Settings
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(628, 397);
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.groupBox4,
																		  this.groupBox3,
																		  this.m_pSave,
																		  this.groupBox2,
																		  this.groupBox1});
			this.Name = "wfrm_Settings";
			this.Text = "wfrm_Settings";
			this.groupBox4.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.m_pPOP3SessionIdle)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pPOP3CommandIdle)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pMaxPOP3badCmds)).EndInit();
			this.groupBox3.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.m_pMaxSMTPbadCmds)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pPostmasterPwd)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pPostmasterUName)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pMaxRecipients)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pMessageSize)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pCommandIdle)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pSessionIdle)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pSave)).EndInit();
			this.groupBox2.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.m_pPOP3IPAddresses)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pPOP3_Threads)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pSMTP_Threads)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pPOP3)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pSMTP)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pSMTPIPAddresses)).EndInit();
			this.groupBox1.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.m_pMailStorePath)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pTest)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pConStrBrowse)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pConStr)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.m_pDbType)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion


		#region Events handling

		#region function m_pConStrBrowse_Click

		private void m_pConStrBrowse_Click(object sender, System.EventArgs e)
		{
			System.Windows.Forms.SaveFileDialog filedlg = new System.Windows.Forms.SaveFileDialog();
		//	filedlg.Filter = ;
			filedlg.InitialDirectory = Application.StartupPath;
			filedlg.RestoreDirectory = true;
			filedlg.ShowDialog();
		}

		#endregion

		#region function m_pSave_Click
		
		private void m_pSave_Click(object sender, System.EventArgs e)
		{
			try
			{
				DataRow dr = dsSettings.Tables["Settings"].Rows[0];
				dr["MailRoot"]                = m_pMailStorePath.Text;
				dr["SMTP_IPAddress"]          = m_pSMTPIPAddresses.Text;
				dr["POP3_IPAddress"]          = m_pPOP3IPAddresses.Text;
				dr["SMTP_Port"]               = m_pSMTP.Text;
				dr["POP3_Port"]               = m_pPOP3.Text;
				dr["SMTP_Threads"]            = m_pSMTP_Threads.Text;
				dr["POP3_Threads"]            = m_pPOP3_Threads.Text;
				dr["SMTP_SessionIdleTimeOut"] = m_pSessionIdle.Text;
				dr["SMTP_CommandIdleTimeOut"] = m_pCommandIdle.Text;
				dr["POP3_SessionIdleTimeOut"] = m_pPOP3SessionIdle.Text;
				dr["POP3_CommandIdleTimeOut"] = m_pPOP3CommandIdle.Text;
				dr["POP3_MaxBadCommands"]     = m_pMaxPOP3badCmds.Text;
				dr["SMTP_MaxBadCommands"]     = m_pMaxSMTPbadCmds.Text;
				dr["MaxMessageSize"]          = m_pMessageSize.Text;
				dr["MaxRecipients"]           = m_pMaxRecipients.Text;
				dr["PostMasterUserName"]      = m_pPostmasterUName.Text;
				dr["PostMasterPassword"]      = m_pPostmasterPwd.Text;
				dr["DataBaseType"]            = m_pDbType.Text;

				if(m_pConStr.Text.Length > 0){
					dr["ConnectionString"] = m_pConStr.Text;
				}

				dsSettings.WriteXml(Application.StartupPath + "\\Settings\\Settings.xml",XmlWriteMode.IgnoreSchema);
			}
			catch(Exception x)
			{
				wfrm_Error frm = new wfrm_Error(x,new System.Diagnostics.StackTrace());
				frm.ShowDialog(this);
			}
		}

		#endregion

		#region function m_pDbType_SelectedIndexChanged

		private void m_pDbType_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			DataRow dr = dsSettings.Tables["Settings"].Rows[0];

			switch(m_pDbType.Text)
			{
				case "XML":
					m_pConStr.Text = "";
					m_pConStr.Enabled = false;
					m_pTest.Enabled = false;
					break;

				case "MSSQL":
					m_pConStr.Text = dr["ConnectionString"].ToString();
					m_pConStr.Enabled = true;
					m_pTest.Enabled = true;
					break;
			}

			if(m_pDbType.IsModified){
				MessageBox.Show(this,"Please press 'Save' button, close manager\nand re-open program again!","Note",MessageBoxButtons.OK,MessageBoxIcon.Information);
		//		m_pConStrManager.DisableTabs();
			}
			else{
		//		m_pConStrManager.EnableTabs();
			}
		}

		#endregion

		#region function m_pTest_ButtonPressed

		private void m_pTest_ButtonPressed(object sender, System.EventArgs e)
		{
			if(ServerAPI.IsConnection(Application.StartupPath + "\\Settings\\",m_pConStr.Text,(DB_Type)Enum.Parse(typeof(DB_Type),m_pDbType.Text))){
				MessageBox.Show("Connection OK.","Information",MessageBoxButtons.OK,MessageBoxIcon.Information);
			}
			else{
				MessageBox.Show(this,"Database connection is invalid!!!","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
			}
		}

		#endregion

		#endregion
		

		#region function RefreshForm

		public void RefreshForm()
		{
			try
			{
				DataRow dr = dsSettings.Tables["Settings"].Rows[0];
				m_pMailStorePath.Text   = dr["MailRoot"].ToString();
				m_pSMTPIPAddresses.Text = dr["SMTP_IPAddress"].ToString();
				m_pPOP3IPAddresses.Text = dr["POP3_IPAddress"].ToString();
				m_pSMTP.Text            = dr["SMTP_Port"].ToString();
				m_pPOP3.Text            = dr["POP3_Port"].ToString();
				m_pSMTP_Threads.Text    = dr["SMTP_Threads"].ToString();
				m_pPOP3_Threads.Text    = dr["POP3_Threads"].ToString();
				m_pSessionIdle.Text     = dr["SMTP_SessionIdleTimeOut"].ToString();
				m_pCommandIdle.Text     = dr["SMTP_CommandIdleTimeOut"].ToString();
				m_pPOP3SessionIdle.Text = dr["POP3_SessionIdleTimeOut"].ToString();
				m_pPOP3CommandIdle.Text = dr["POP3_CommandIdleTimeOut"].ToString();
				m_pMaxPOP3badCmds.Text  = dr["POP3_MaxBadCommands"].ToString();
				m_pMaxSMTPbadCmds.Text  = dr["SMTP_MaxBadCommands"].ToString();
				m_pMessageSize.Text     = dr["MaxMessageSize"].ToString();
				m_pMaxRecipients.Text   = dr["MaxRecipients"].ToString();
				m_pPostmasterUName.Text = dr["PostMasterUserName"].ToString();
				m_pPostmasterPwd.Text   = dr["PostMasterPassword"].ToString();
				m_pDbType.SelectItemByTag(dr["DataBaseType"].ToString());

				if(m_pDbType.Text == "MSSQL"){
					m_pConStr.Text = dr["ConnectionString"].ToString();
					m_pConStr.Enabled = true;
					m_pTest.Enabled = true;
				}

			}
			catch(Exception x)
			{
				wfrm_Error frm = new wfrm_Error(x,new System.Diagnostics.StackTrace());
				frm.ShowDialog(this);
			}
		}

		#endregion
				
	}	
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Estonia Estonia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions