Compare commits
4 Commits
94207ebe45
...
ec3b6371cc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec3b6371cc | ||
|
|
8a31bc82db | ||
|
|
9899f6867d | ||
|
|
847c7575c4 |
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.5.7.0")>
|
||||
<Assembly: AssemblyFileVersion("1.5.7.0")>
|
||||
<Assembly: AssemblyVersion("1.5.8.0")>
|
||||
<Assembly: AssemblyFileVersion("1.5.8.0")>
|
||||
|
||||
@@ -34,7 +34,7 @@ Public Class PDFEmbeds
|
||||
oFileInfo = New FileInfo(FilePath)
|
||||
|
||||
Logger.Debug("Filename: {0}", oFileInfo.Name)
|
||||
Logger.Debug("Filesize: {0}", oFileInfo.Length)
|
||||
Logger.Debug("Filesize: {0} bytes", oFileInfo.Length)
|
||||
Logger.Debug("Exists: {0}", oFileInfo.Exists)
|
||||
Catch ex As Exception
|
||||
Logger.Warn("File information for [{0}] could not be read!", FilePath)
|
||||
|
||||
@@ -290,7 +290,7 @@ Public Class Email2
|
||||
''' <returns>The path of the new EML without attachments.</returns>
|
||||
Public Function Remove_AttachmentsFromEmail(pFileName As String, Optional pSuffix As String = "") As String
|
||||
Try
|
||||
Dim oTempPath As String = Path.Combine(Path.GetTempPath(), Add_FilenameSuffix(pFileName, pSuffix))
|
||||
Dim oTempPath As String = Path.Combine(Path.GetTempPath(), Add_FilenameSuffix(pFileName, pSuffix, ".eml"))
|
||||
Dim oCleanedPath As String = FileEx.GetCleanPath(oTempPath)
|
||||
Dim oVersionedPath As String = FileEx.GetVersionedFilename(oCleanedPath)
|
||||
Dim oEmlPath As String = MaybeConvert_MsgToEml(pFileName)
|
||||
@@ -412,20 +412,28 @@ Public Class Email2
|
||||
|
||||
Private Function DoConvertMsgToEmlFile(pMsgFile As String) As String
|
||||
Try
|
||||
Logger.Debug("Converting Msg file to Eml: [{0}]", pMsgFile?.ToString)
|
||||
|
||||
Dim oTempPath As String = IO.Path.GetTempPath()
|
||||
Dim oFileNameWithoutExtension = Path.GetFileNameWithoutExtension(pMsgFile)
|
||||
Dim oFileNameWithoutInvalidChars = Language.Utils.RemoveInvalidCharacters(oFileNameWithoutExtension)
|
||||
Dim oEmlPath As String = IO.Path.Combine(oTempPath, $"{oFileNameWithoutInvalidChars}.eml")
|
||||
Dim oVersionedPath As String = FileEx.GetVersionedFilename(oEmlPath)
|
||||
|
||||
Logger.Debug("New Path for Eml file: [{0}]", oVersionedPath)
|
||||
|
||||
Using oConverter As New MsgConverter(pMsgFile)
|
||||
Logger.Debug("Converter created")
|
||||
Dim oEmail As IMail = oConverter.CreateMessage()
|
||||
Logger.Debug("Message created")
|
||||
Dim oData As Byte() = oEmail.Render()
|
||||
Logger.Debug("Message rendered")
|
||||
|
||||
oEmail.Save(oVersionedPath)
|
||||
|
||||
Logger.Debug("Message saved")
|
||||
End Using
|
||||
|
||||
Logger.Info("Msg File successfully converted to Eml: [{0}]", oVersionedPath)
|
||||
TempFiles.Add(oVersionedPath)
|
||||
Return oVersionedPath
|
||||
|
||||
@@ -437,16 +445,20 @@ Public Class Email2
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function Add_FilenameSuffix(pFilename As String, pSuffix As String)
|
||||
Private Function Add_FilenameSuffix(pFilename As String, pSuffix As String, Optional pExtension As String = Nothing)
|
||||
Dim oFileInfo As New FileInfo(pFilename)
|
||||
Dim oExtension As String = oFileInfo.Extension
|
||||
|
||||
If pExtension IsNot Nothing Then
|
||||
If pExtension.StartsWith(".") = False Then
|
||||
oExtension = $".{pExtension}"
|
||||
Else
|
||||
oExtension = pExtension
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim oFileNameWithoutExtension = Path.GetFileNameWithoutExtension(pFilename)
|
||||
|
||||
Return $"{oFileNameWithoutExtension}{pSuffix}{oExtension}"
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.2.7.0")>
|
||||
<Assembly: AssemblyFileVersion("1.2.7.0")>
|
||||
<Assembly: AssemblyVersion("1.2.8.0")>
|
||||
<Assembly: AssemblyFileVersion("1.2.8.0")>
|
||||
|
||||
Reference in New Issue
Block a user