void BeginPullData() { string connectionString = txtConnString.Text; DBLib.SMTPSetting smtpSetting = new DBLib.SMTPSetting(txtMailServerAddress.Text, Convert.ToInt32(txtPOPServerPort.Text), txtUser.Text, txtPassword.Text, chkEnableSecurity.Checked, chkUseGmail.Checked); dbLibServer = new DBLib.DBServerApi(smtpSetting); if (chkEnableSecurity.Checked) { smtpSetting.CAPath = txtCAPath.Text; } //string message = dbLibServer.LoginPopServerMail(); //if(message != "") //{ // MessageBox.Show(message, "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Error); // return; //} btnStart.Enabled = false; btnStop.Enabled = true; dbLibServer.intervalRequest = Convert.ToDouble(txtIntervalTimer.Text); dbLibServer.connectionString = connectionString; processReadMail = new Thread(MethodReceiveMail); processReadMail.Start(dbLibServer); }
void MethodReceiveMail(object obj) { DBLib.DBServerApi _dbLib = (DBLib.DBServerApi)obj; _dbLib.StartTimerReadEmail(); }