1. Kevin Dinh
  2. PowerBuilder
  3. Wednesday, 16 August 2023 18:57 PM UTC

Hello All,

I need some help with attaching PDF file to email using OAuth2.0 method.

I have no issue with attach simple plain text file to the email.  But unable to attach the PDF (encoded to base64).  The program just crashed.

I followed the sample code from the Microsoft link below.

user: sendMail - Microsoft Graph v1.0 | Microsoft Learn

"attachments": [ { "@odata.type": "#microsoft.graph.fileAttachment", "name": "attachment.txt", "contentBytes": "SGVsbG8gV29ybGQh" }

Since the "contentBytes" expects the content to be encoded to base64.

I tried to pass in the SetBody() as String and Blob.  Both failed.

OAuthRequest objects

Syntax

objectname.SetBody ( string data )
objectname.SetBody ( blob data )

Any help would be greatly appreciated.

Thanks,

Kevin

 



There are no replies made for this question yet.
However, you are not allowed to reply to this question.