- Kevin Dinh
- PowerBuilder
- Wednesday, 16 August 2023 06: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
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.