Attach PDF files to Outlook email in byte array format

Hi there,

I am calling an external API for retrieving a pdf file. The API gives me a byte array. Now what I want is to upload this byte array as an attachment to an outlook email. I also want to name the attachment file. Does anyone knows how can I achieve that? I am using Microsoft 365 Scope activity and Send Email activity.

Thanks for looking into this.


Ideally you should be converting the byte array to pdf and then attach

Dim bytes As Byte() = Convert.FromBase64String(Your_base64BinaryStr)
File.WriteAllBytes(“Your_FolderPath\Your_pdfFileName.pdf”, bytes)