Search code examples
chilkat

Chilkat Email Object - Save email without attachments


I need to save the email without the attachments in EML format with Chilkat. I'm using VB.NET and an IMAP connection and I have already checked SaveAllAttachments (that does the opposite saving only the attachments) and SaveEml (for email with attachments included).

                'Attachments only
                email.SaveAllAttachments(MyInPath)

                'Email with attachments in EML format
                email.SaveEml(MyInPath & "\" & email.GenerateFilename())

I'd like to keep a regular EML format (with header, sender, subject, body erc.) but without the attachments (so not just the body on a TXT file).

Is there a way to do it simply?


Solution

  • Someone who deleted his post (I don't know why) said to use email.DropAttachments() and posted this link: https://www.chilkatsoft.com/refdoc/vbnetEmailRef.html

    It's a little bit strange to save the whole email and then delete the attachments but it simply works