MS Limilabs etc
This commit is contained in:
@@ -13,13 +13,14 @@ Public Class frmMain
|
||||
Private _database As clsDatabase
|
||||
Private _Encryption As clsEncryption
|
||||
Private _windream As clsWindream_allgemein
|
||||
Private _email As clsEmail
|
||||
' Private _email As clsEmail
|
||||
Private _emailIMAP As clsEmailIMAP
|
||||
Private _LoadInProgress As Boolean = True
|
||||
Private _RunwithLocalemail As Boolean = False
|
||||
Private _Localemail As String
|
||||
Private _SQLServerConString As String
|
||||
Private _Worklist As List(Of String)
|
||||
Private _limilab As DigitalData.Modules.Messaging.Limilab
|
||||
|
||||
|
||||
Public Sub New()
|
||||
|
||||
@@ -33,7 +34,11 @@ Public Class frmMain
|
||||
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
Try
|
||||
MyLogger = New LogConfig(LogConfig.PathType.CustomPath, Path.Combine(My.Application.Info.DirectoryPath, "Log"), Nothing, My.Application.Info.CompanyName, My.Application.Info.ProductName)
|
||||
_limilab = New Limilab(MyLogger)
|
||||
Logger = MyLogger.GetLogger()
|
||||
If My.Settings.DEBUG = True Then
|
||||
Logger.Info("!! DEBUG is ACTIVE !!")
|
||||
End If
|
||||
MyLogger.Debug = My.Settings.DEBUG
|
||||
InitDatabase()
|
||||
ToolStripProgressBar1.Visible = False
|
||||
@@ -42,7 +47,7 @@ Public Class frmMain
|
||||
_windream = New clsWindream_allgemein(MyLogger)
|
||||
End If
|
||||
|
||||
_email = New clsEmail(MyLogger)
|
||||
'_email = New clsEmail(MyLogger)
|
||||
_emailIMAP = New clsEmailIMAP(MyLogger, _SQLServerConString)
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in FormLoad")
|
||||
@@ -281,15 +286,16 @@ Public Class frmMain
|
||||
|
||||
Private Sub BackgroundWorker1_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
|
||||
If _RunwithLocalemail = False Then
|
||||
|
||||
MyLogger.Debug = True
|
||||
Dim _work As New clsWorker(MyLogger, _SQLServerConString, GUIDTextBox.Text, My.Settings.FB_DATASOURCE, My.Settings.FB_DATABASE, My.Settings.FB_USER, My.Settings.FB_PW, My.Settings.USE_WM)
|
||||
Dim _work As New clsWorker(MyLogger, _SQLServerConString, GUIDTextBox.Text, My.Settings.FB_DATASOURCE, My.Settings.FB_DATABASE, My.Settings.FB_USER, My.Settings.FB_PW,
|
||||
My.Settings.USE_WM, ToolStripEmailAccountID.Text)
|
||||
_work.Start_WorkingProfiles()
|
||||
|
||||
Else
|
||||
For Each ofile As String In _Worklist
|
||||
_Localemail = ofile
|
||||
Logger.Info($"## Manual working on file {ofile} ... ")
|
||||
Dim _work As New clsWorker(MyLogger, _SQLServerConString, GUIDTextBox.Text, My.Settings.FB_DATASOURCE, My.Settings.FB_DATABASE, My.Settings.FB_USER, My.Settings.FB_PW, My.Settings.USE_WM, _Localemail)
|
||||
Dim _work As New clsWorker(MyLogger, _SQLServerConString, GUIDTextBox.Text, My.Settings.FB_DATASOURCE, My.Settings.FB_DATABASE, My.Settings.FB_USER, My.Settings.FB_PW, My.Settings.USE_WM, ofile)
|
||||
_work.Start_WorkingProfiles(True)
|
||||
Next
|
||||
|
||||
@@ -339,6 +345,10 @@ Public Class frmMain
|
||||
End Sub
|
||||
|
||||
Private Sub tsbtnRunProfiles_Click(sender As Object, e As EventArgs) Handles tsbtnRunProfiles.Click
|
||||
If IsNumeric(ToolStripEmailAccountID.Text) = False Then
|
||||
MsgBox("Choose an email-Profile before running processes!", MsgBoxStyle.Exclamation)
|
||||
Exit Sub
|
||||
End If
|
||||
_RunwithLocalemail = False
|
||||
If Not BackgroundWorker1.IsBusy Then
|
||||
tsbtnRunProfiles.Enabled = False
|
||||
@@ -348,6 +358,10 @@ Public Class frmMain
|
||||
End If
|
||||
End Sub
|
||||
Private Sub ToolStripButton28_Click(sender As Object, e As EventArgs) Handles tsbtnRunLocalMail.Click
|
||||
If IsNumeric(ToolStripEmailAccountID.Text) = False Then
|
||||
MsgBox("Choose an email-Profile before running processes!", MsgBoxStyle.Exclamation)
|
||||
Exit Sub
|
||||
End If
|
||||
If Not BackgroundWorker1.IsBusy Then
|
||||
Dim openFileDialog1 As New OpenFileDialog()
|
||||
|
||||
@@ -714,8 +728,10 @@ Public Class frmMain
|
||||
My.Settings.Save()
|
||||
Dim PWPlain = _Encryption.DecryptData(EMAIL_PWTextBox.Text)
|
||||
|
||||
If _email.Email_Send_Independentsoft("Testmail", "This is the body (text will be replaced within profile)", txtTestmail.Text,
|
||||
EMAIL_FROMTextBox.Text, EMAIL_SMTPTextBox.Text, PORTTextBox.Text, EMAIL_USERTextBox.Text, PWPlain, AUTH_TYPEComboBox.Text, "") = True Then
|
||||
If _limilab.NewSMTPEmail(txtTestmail.Text, "Testmail", "This is the body (text will be replaced within profile)", EMAIL_FROMTextBox.Text, EMAIL_SMTPTextBox.Text, PORTTextBox.Text,
|
||||
EMAIL_USERTextBox.Text, PWPlain, AUTH_TYPEComboBox.Text, "frmMain-Test", "", "", True) = True Then
|
||||
|
||||
|
||||
MsgBox("Email was send successfully.", MsgBoxStyle.Information)
|
||||
Else
|
||||
MsgBox("Could not send the testmail. Please check the log.", MsgBoxStyle.Exclamation)
|
||||
@@ -732,15 +748,8 @@ Public Class frmMain
|
||||
|
||||
Dim PWPlain = _Encryption.DecryptData(oDT.Rows(0).Item("EMAIL_PW"))
|
||||
'Logger.Debug($"PWis !{PWPlain}35452dd=")
|
||||
Dim oResult
|
||||
'If chkS22.Checked Then
|
||||
oResult = _emailIMAP.FetchIMAPMessagesS22(oDT.Rows(0).Item("EMAIL_SMTP"), oDT.Rows(0).Item("PORT_IN"), oDT.Rows(0).Item("EMAIL_USER"), PWPlain, txtInboxname.Text, True, chkDeleteMail.Checked,
|
||||
ARCHIVE_FOLDERTextBox.Text)
|
||||
'Else
|
||||
'oResult = _emailIMAP.FetchIMAPMessagesIsoft(EMAIL_SMTPTextBox.Text, PORT_INTextBox.Text, EMAIL_USERTextBox.Text, PWPlain, txtInboxname.Text,
|
||||
'ARCHIVE_FOLDERTextBox.Text, Path.Combine(My.Application.Info.DirectoryPath, "Log") & "\IsoftLog.txt", True, chkDeleteMail.Checked)
|
||||
'End If
|
||||
|
||||
_limilab.InitIMAP(oDT.Rows(0).Item("EMAIL_SMTP"), oDT.Rows(0).Item("PORT_IN"), oDT.Rows(0).Item("EMAIL_USER"), PWPlain, oDT.Rows(0).Item("AUTH_TYPE"))
|
||||
Dim oResult = _limilab.IMAPTestLogin()
|
||||
|
||||
If oResult = False Then
|
||||
MsgBox("Access Imap NOT successfull", MsgBoxStyle.Critical)
|
||||
@@ -753,12 +762,6 @@ Public Class frmMain
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
|
||||
My.Settings.Save()
|
||||
Dim PWPlain = _Encryption.DecryptData(EMAIL_PWTextBox.Text)
|
||||
_email.TEST_POP3_COLLECT(EMAIL_SMTPTextBox.Text, PORTTextBox.Text, EMAIL_USERTextBox.Text, PWPlain)
|
||||
End Sub
|
||||
|
||||
Private Sub btnTestRegEx_Click(sender As Object, e As EventArgs) Handles btnTestRegEx.Click
|
||||
txtResultRegEx.Text = ""
|
||||
Try
|
||||
@@ -889,43 +892,32 @@ Public Class frmMain
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
|
||||
Dim _ss2email As New Email(MyLogger)
|
||||
If txtTestmail.Text <> String.Empty Then
|
||||
My.Settings.Save()
|
||||
Dim PWPlain = _Encryption.DecryptData(EMAIL_PWTextBox.Text)
|
||||
|
||||
If _ss2email.NewEmail(txtTestmail.Text, "Testmail SSMail", "This is the body (text will be replaced within profile)", EMAIL_FROMTextBox.Text, EMAIL_SMTPTextBox.Text, PORTTextBox.Text, EMAIL_USERTextBox.Text, PWPlain, AUTH_TYPEComboBox.Text, "GUI Test", "") = True Then
|
||||
MsgBox("Email was send successfully.", MsgBoxStyle.Information)
|
||||
Else
|
||||
MsgBox("Could not send the testmail. Please check the log.", MsgBoxStyle.Exclamation)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub chkS22_CheckedChanged(sender As Object, e As EventArgs)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
|
||||
My.Settings.Save()
|
||||
Dim PWPlain = _Encryption.DecryptData(EMAIL_PWTextBox.Text)
|
||||
'Logger.Debug($"PWis !{PWPlain}35452dd=")
|
||||
Dim oResult
|
||||
|
||||
oResult = _emailIMAP.IMAP_Set2Seen(EMAIL_SMTPTextBox.Text, PORT_INTextBox.Text, EMAIL_USERTextBox.Text, PWPlain, Path.Combine(My.Application.Info.DirectoryPath, "Log") & "\IsoftLog.txt")
|
||||
|
||||
|
||||
|
||||
If oResult = False Then
|
||||
MsgBox("Access Imap NOT successfull", MsgBoxStyle.Critical)
|
||||
Else
|
||||
MsgBox("Test Successful!", MsgBoxStyle.Information)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub COMMENTTextBox_Leave(sender As Object, e As EventArgs) Handles COMMENTTextBox.Leave
|
||||
Dim separatorIndex = COMMENTTextBox.Text.IndexOf(".")
|
||||
TextBox1.Text = COMMENTTextBox.Text.Substring(separatorIndex, COMMENTTextBox.Text.Length - 1)
|
||||
End Sub
|
||||
|
||||
Private Sub EMAILIDTextBox_TextChanged(sender As Object, e As EventArgs) Handles EMAILIDTextBox.TextChanged
|
||||
If IsNumeric(EMAILIDTextBox) Then
|
||||
ToolStripEmailAccountID.Text = EMAILIDTextBox.Text
|
||||
Else
|
||||
ToolStripEmailAccountID.Text = "Choose Email-Config"
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub AUTH_TYPEComboBox_SelectedIndexChanged(sender As Object, e As EventArgs) Handles AUTH_TYPEComboBox.SelectedIndexChanged
|
||||
If AUTH_TYPEComboBox.SelectedIndex <> -1 Then
|
||||
Select Case AUTH_TYPEComboBox.SelectedIndex
|
||||
Case 0 'Start TLS
|
||||
PORT_INTextBox.Enabled = False
|
||||
Case 1 'SSL/TLS
|
||||
PORT_INTextBox.Enabled = True
|
||||
End Select
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user