Compare commits
2 Commits
ec3b6371cc
...
d887fe107c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d887fe107c | ||
|
|
3d39d7303b |
@@ -290,12 +290,18 @@ Public Class Email2
|
|||||||
''' <returns>The path of the new EML without attachments.</returns>
|
''' <returns>The path of the new EML without attachments.</returns>
|
||||||
Public Function Remove_AttachmentsFromEmail(pFileName As String, Optional pSuffix As String = "") As String
|
Public Function Remove_AttachmentsFromEmail(pFileName As String, Optional pSuffix As String = "") As String
|
||||||
Try
|
Try
|
||||||
Dim oTempPath As String = Path.Combine(Path.GetTempPath(), Add_FilenameSuffix(pFileName, pSuffix, ".eml"))
|
' Convert possible msg file to eml
|
||||||
|
Dim oEmlPath As String = MaybeConvert_MsgToEml(pFileName)
|
||||||
|
|
||||||
|
' Clean and version new path
|
||||||
|
Dim oTempPath As String = Path.Combine(Path.GetTempPath(), Add_FilenameSuffix(oEmlPath, pSuffix, ".eml"))
|
||||||
Dim oCleanedPath As String = FileEx.GetCleanPath(oTempPath)
|
Dim oCleanedPath As String = FileEx.GetCleanPath(oTempPath)
|
||||||
Dim oVersionedPath As String = FileEx.GetVersionedFilename(oCleanedPath)
|
Dim oVersionedPath As String = FileEx.GetVersionedFilename(oCleanedPath)
|
||||||
Dim oEmlPath As String = MaybeConvert_MsgToEml(pFileName)
|
|
||||||
|
' Load eml file
|
||||||
Dim oMail = MailBuilder.CreateFromEmlFile(oEmlPath)
|
Dim oMail = MailBuilder.CreateFromEmlFile(oEmlPath)
|
||||||
|
|
||||||
|
' Remove attachments and save
|
||||||
oMail.RemoveAttachments()
|
oMail.RemoveAttachments()
|
||||||
oMail.Save(oVersionedPath)
|
oMail.Save(oVersionedPath)
|
||||||
|
|
||||||
|
|||||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("1.2.8.0")>
|
<Assembly: AssemblyVersion("1.2.9.0")>
|
||||||
<Assembly: AssemblyFileVersion("1.2.8.0")>
|
<Assembly: AssemblyFileVersion("1.2.9.0")>
|
||||||
|
|||||||
Reference in New Issue
Block a user