From 36e2d97b20716ee4b21131befb4576e9657a2bde Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 11 Oct 2023 15:08:24 +0200 Subject: [PATCH] fix --- app/ResultHandler_Konfig/frmMain.vb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/ResultHandler_Konfig/frmMain.vb b/app/ResultHandler_Konfig/frmMain.vb index 0225f18..f4674e0 100644 --- a/app/ResultHandler_Konfig/frmMain.vb +++ b/app/ResultHandler_Konfig/frmMain.vb @@ -912,26 +912,27 @@ Public Class frmMain End Sub Private Sub btnsendtestmail_Click(sender As Object, e As EventArgs) Handles btnsendtestmail.Click ' Dim _ss2email As New Email(MyLogger) - Dim llmail As New MailSender(MyLogger) + Dim oSender As New MailSender(MyLogger) If txtTestmailTo.Text <> String.Empty Then My.Settings.Save() Dim wrapper As New clsEncryption("!35452didalog=") Dim PWPlain = wrapper.DecryptData(EMAIL_PWTextBox.Text) - If llmail.ConnectToServer(EMAIL_SMTPTextBox.Text, PORTTextBox.Text, EMAIL_USERTextBox.Text, PWPlain, AUTH_TYPEComboBox.Text) = True Then + Dim oSession = oSender.Connect(EMAIL_SMTPTextBox.Text, PORTTextBox.Text, EMAIL_USERTextBox.Text, PWPlain, AUTH_TYPEComboBox.Text) + If oSession.Connected = True Then Dim oSendto As New List(Of String) oSendto.Add(txtTestmailTo.Text) Dim oAttMt As New List(Of String) If txtAttachment.Text <> String.Empty Then oAttMt.Add(txtAttachment.Text) End If - If llmail.SendMail(oSendto, EMAIL_FROMTextBox.Text, "Testmail from GUI WMResultHandler", "TEST", Now, oAttMt, 1) = True Then + If oSender.SendMail(oSendto, EMAIL_FROMTextBox.Text, "Testmail from GUI WMResultHandler", "TEST", Now, oAttMt, 1) = True Then MsgBox("Email has been sent successfully.", MsgBoxStyle.Information) Else MsgBox("Could not send the testmail. Please check the log.", MsgBoxStyle.Exclamation) End If - llmail.DisconnectFromServer() + oSender.Disconnect() Else MsgBox("Could not connect to server. Please check the log.", MsgBoxStyle.Exclamation)