Automailversand, Fremdrechnungen, etc.
This commit is contained in:
@@ -381,7 +381,7 @@ Public Class cAutomailversand
|
||||
Next
|
||||
|
||||
|
||||
If VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(EMails, EMail_subject, EMail_HTML, "mmdabrechnung@verag.ag", False, False, EMails_CC, EMails_BCC, attachList) Then
|
||||
If VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(EMails, EMail_subject, EMail_HTML, "mmdabrechnung@verag.ag", False, False, EMails_CC, EMails_BCC, attachList,, "mmdabrechnung@verag.ag") Then
|
||||
API.UPDTAE_OK()
|
||||
mailcreated = True
|
||||
Else
|
||||
|
||||
@@ -839,7 +839,7 @@ Public Class usrcntlFremdrechnungen
|
||||
|
||||
If Mail IsNot Nothing Then
|
||||
|
||||
If VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(API.api_EMail, API.api_EMailSubject, API.api_EMailText, "mmdabrechnung@verag.ag", False, False, API.api_EMailCC, API.api_EMailBCC, pdflist) Then
|
||||
If VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(API.api_EMail, API.api_EMailSubject, API.api_EMailText, "mmdabrechnung@verag.ag", False, False, API.api_EMailCC, API.api_EMailBCC, pdflist,, "mmdabrechnung@verag.ag") Then
|
||||
API.UPDTAE_OK()
|
||||
|
||||
Else
|
||||
|
||||
@@ -5,7 +5,7 @@ Imports System.Windows.Forms
|
||||
|
||||
Public Class cErrorHandler
|
||||
|
||||
Public Shared Sub ERR(message As String, stack As String, functionName As String, Optional OP As String = "", Optional title As String = "", Optional mailadess As String = "error@verag.ag", Optional recieverMailAdress As String = "", Optional zusatz As String = "", Optional errCode As String = Nothing)
|
||||
Public Shared Sub ERR(message As String, stack As String, functionName As String, Optional OP As String = "", Optional title As String = "", Optional mailadess As String = "error@verag.ag", Optional recieverMailAdress As String = "", Optional zusatz As String = "", Optional errCode As String = Nothing, Optional furtherMailAdress As String = "")
|
||||
If OP = "" Then OP = VERAG_PROG_ALLGEMEIN.cAllgemein.ERR_OP_GLOBAL ' GLobal gesetzes Errorhandling! (Standart=SHOW)
|
||||
|
||||
'If Form.ActiveForm IsNot Nothing Then
|
||||
@@ -19,7 +19,7 @@ Public Class cErrorHandler
|
||||
|
||||
Select Case OP
|
||||
Case ERROR_OP.MAIL
|
||||
sendERRORperMail(title & " | " & My.Application.Info.AssemblyName, message, stack, mailadess, zusatz, functionName)
|
||||
sendERRORperMail(title & " | " & My.Application.Info.AssemblyName, message, stack, mailadess, zusatz, functionName, furtherMailAdress)
|
||||
Case ERROR_OP.SHOW
|
||||
Dim c As New cProgramFunctions
|
||||
Dim url = c.MakeScreenshot()
|
||||
@@ -44,7 +44,7 @@ Public Class cErrorHandler
|
||||
|
||||
End Sub
|
||||
|
||||
Public Shared Sub sendERRORperMail(title, errmsg, errstack, recieverMailAdress, zusatz, functionName)
|
||||
Public Shared Sub sendERRORperMail(title, errmsg, errstack, recieverMailAdress, zusatz, functionName, furtherMailAdress)
|
||||
Dim Msg As New MailMessage
|
||||
Dim myCredentials As New System.Net.NetworkCredential
|
||||
'myCredentials.UserName = "support@verag.ag"
|
||||
@@ -66,6 +66,8 @@ Public Class cErrorHandler
|
||||
Msg.From = New MailAddress("edv@verag.ag")
|
||||
Msg.To.Add(recieverMailAdress)
|
||||
|
||||
If furtherMailAdress <> "" Then Msg.To.Add(furtherMailAdress)
|
||||
|
||||
Msg.Subject = title '"ERROR - DAKOSY Einarbeitung"
|
||||
Msg.Body = "Uhrzeit: " & Now.ToShortDateString & " " & Now.ToShortTimeString
|
||||
Msg.Body = "Function: " & functionName
|
||||
|
||||
@@ -441,7 +441,7 @@ BindingFlags.Instance Or BindingFlags.NonPublic, Nothing, [Control], New Object(
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Shared Function sendMail(eMailTo, betreff, text, Optional eMailfrom = "support@verag.ag", Optional prio = False, Optional uhrzeitAngeben = True, Optional cc = "", Optional bcc = "", Optional anhaenge = Nothing, Optional art = 0)
|
||||
Public Shared Function sendMail(eMailTo, betreff, text, Optional eMailfrom = "support@verag.ag", Optional prio = False, Optional uhrzeitAngeben = True, Optional cc = "", Optional bcc = "", Optional anhaenge = Nothing, Optional art = 0, Optional furtherMailAdress = "")
|
||||
Dim Msg As New MailMessage
|
||||
Dim myCredentials As New System.Net.NetworkCredential
|
||||
Msg.IsBodyHtml = True
|
||||
@@ -549,7 +549,7 @@ BindingFlags.Instance Or BindingFlags.NonPublic, Nothing, [Control], New Object(
|
||||
|
||||
Catch ex As Exception
|
||||
Try
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR("MAIL ERROR - VOR SENDEN" & ex.Message, "TO: " & eMailTo & vbNewLine & "SUBJ: " & betreff & vbNewLine & "TXT: " & text, ex.StackTrace, System.Reflection.MethodBase.GetCurrentMethod.Name, VERAG_PROG_ALLGEMEIN.ERROR_OP.MAIL)
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR("MAIL ERROR - VOR SENDEN" & ex.Message, "TO: " & eMailTo & vbNewLine & "SUBJ: " & betreff & vbNewLine & "TXT: " & text, ex.StackTrace, System.Reflection.MethodBase.GetCurrentMethod.Name, VERAG_PROG_ALLGEMEIN.ERROR_OP.MAIL,,,,, furtherMailAdress)
|
||||
Catch ex2 As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR("MAIL ERROR - VOR SENDEN LOG! " & ex2.Message, "TO: " & eMailTo & vbNewLine & "SUBJ: " & betreff & vbNewLine & "TXT: " & text, ex2.StackTrace, System.Reflection.MethodBase.GetCurrentMethod.Name, VERAG_PROG_ALLGEMEIN.ERROR_OP.LOG)
|
||||
End Try
|
||||
@@ -559,7 +559,7 @@ BindingFlags.Instance Or BindingFlags.NonPublic, Nothing, [Control], New Object(
|
||||
|
||||
'Prüfen, ob Empfänger angegeben:
|
||||
If Msg.To.Count = 0 And Msg.CC.Count = 0 And Msg.Bcc.Count = 0 Then
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR("Kein Empfänger!", "TO: " & eMailTo & vbNewLine & "SUBJ: " & betreff & vbNewLine & "TXT: " & text, System.Reflection.MethodBase.GetCurrentMethod.Name, VERAG_PROG_ALLGEMEIN.ERROR_OP.MAIL)
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR("Kein Empfänger!", "TO: " & eMailTo & vbNewLine & "SUBJ: " & betreff & vbNewLine & "TXT: " & text, System.Reflection.MethodBase.GetCurrentMethod.Name, VERAG_PROG_ALLGEMEIN.ERROR_OP.MAIL,,,,,, furtherMailAdress)
|
||||
Return False
|
||||
End If
|
||||
|
||||
@@ -579,7 +579,7 @@ BindingFlags.Instance Or BindingFlags.NonPublic, Nothing, [Control], New Object(
|
||||
Catch ex As Exception
|
||||
Try 'Falls Fehler nicht beim Senden, sonder was anderes.
|
||||
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, "TO: " & eMailTo & vbNewLine & "SUBJ: " & betreff & vbNewLine & "TXT: " & text, ex.StackTrace, System.Reflection.MethodBase.GetCurrentMethod.Name, VERAG_PROG_ALLGEMEIN.ERROR_OP.MAIL)
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, "TO: " & eMailTo & vbNewLine & "SUBJ: " & betreff & vbNewLine & "TXT: " & text, ex.StackTrace, System.Reflection.MethodBase.GetCurrentMethod.Name, VERAG_PROG_ALLGEMEIN.ERROR_OP.MAIL,,,,, furtherMailAdress)
|
||||
Catch ex3 As Exception
|
||||
End Try
|
||||
|
||||
|
||||
Reference in New Issue
Block a user