Archived Forum Post

Index of archived forum posts

Question:

Remove Start of body

Aug 04 '17 at 08:53

Hi!

I have a small issue where I need to remove the body in the email. Marked with bold is this even possible?

By dumping the .eml file to disk this is what I get;

    MIME-Version: 1.0
Date: Thu, 03 Aug 2017 17:32:44 +0200
Message-ID: <d05be05282ab47eb10e490abd6fe94501a050ee3@item-s36546>
X-Priority: 3 (Normal)
CKX-Bounce-Address: From@Address.com
From: From@Address.com
Subject: This is subject
Content-Type: multipart/mixed;
     boundary="------------090606030907080305090305"

**--------------090606030907080305090305
Content-Type: text/plain
Content-Transfer-Encoding: 7bit**

--------------090606030907080305090305
Content-Type: application/octet-stream;
     name="MyFile.myFileExtension"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="MyFile.myFileExtension"

FBUWFxg=

--------------090606030907080305090305--

As you can see I have an attachment, which basically is a few bytes, just for test purposes. The system I'm sending the mail to does not expect a body in the mail and therefore that system will fail(I have no control over this system). Is it somehow possible to remove the header of the body? so the result would be

    MIME-Version: 1.0
    Date: Thu, 03 Aug 2017 17:32:44 +0200
    Message-ID: <d05be05282ab47eb10e490abd6fe94501a050ee3@item-s36546>
    X-Priority: 3 (Normal)
    CKX-Bounce-Address: From@Address.com
    From: From@Address.com
    Subject: This is subject
    Content-Type: multipart/mixed;
         boundary="------------090606030907080305090305"

--------------090606030907080305090305
    Content-Type: application/octet-stream;
         name="MyFile.myFileExtension"
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment; filename="MyFile.myFileExtension"

FBUWFxg=

--------------090606030907080305090305--


Answer

Perhaps try the RemovePlainTextAlternative or RemoveAttachedMessage methods? I haven't tested them myself, but they look promising.