Dynamics CRM – Attach attachment to email without saving the file to a server / 0 sized byte array / empty files

Dynamics CRM ProTip: NEVER add a service account as a user account
November 6, 2019
SharePoint Online – Get Image from publishing site list – JavaScript & Regex
February 25, 2020

Dynamics CRM – Attach attachment to email without saving the file to a server / 0 sized byte array / empty files

Had an interesting moment this week where we were uploading files to an email without issue, but if you were to open up the attachments they’d be completely blank even though the size of the file was as expected. The actual file contents weren’t being uploaded properly.

The requirement is to attach a file to an email, without saving the attachment anywhere. So… This works.

The original code was below.

Jason
Jason
I do things in the clloouuudddd