Hi everyone.
I made a flow which is to attach PDF file (Japanese contents) to an email (outlook) and send it, but when I download the attached file from the sent message, the file is broken.
The error message is: PDF file couldn't be opened. because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded).
Any assistance in this matter would be greatly appreciated. Thank you!
Hey @S140
if your workflow does not give any error that it should be able to send Email.
Just check once that the Email is valid or not.
After completion of the run of the workflow check the value of the email field that what value it holds inside the output parameter.
------------------------------------------------------------------------------------------------------------------------------
If my suggestion helped you, please give it a Thumbs up 👍 and Mark it as a Solution ✔️.
This motivates me solve more problems.
Thanks,
Sayan Patra
RPA Developer
Hi @Sayan ,
Thank you so much for your help again.
When I run this flow, I do not get any errors, however, no emails are sent (I checked in my sent items).
Am I doing wrong with Step 6 ?
Step 6: Send Email with options
・"To" >> I choose a value from excel file like below screenshot.
・"Attachments" >> Name ( variables('SplitPath')[sub(variables('Length'),1)] )
ContentBytes (FilePath)
Hey @S140
can you please share that what the error you are facing?
Before sending the email with options You have to Get file content using path.
Solution:
I am again sharing the flow please follow this -
Step 1: Start with a Trigger
Step 2: Initialize Variables
FilePath: String
Length: Integer
SplitPath: Array
Step 3: Use Action - List rows present in a table
Step 4: Use Action - Apply to each
Inside Apply to each:
Set Variable:
Name: FilePath
Value: Choose the column which contains the FilePath (for example, the Path column).
Example Value: C:\Users\SayanPatra\OneDrive - XYZ LLC\Desktop\sayan\cian.pdf
Set Variable:
Name: SplitPath
Value: split(variables('FilePath'),'\')
This expression splits the file path based on "\" to extract the file content later.
Set Variable:
Name: Length
Set Variable :
Name - FilePath
This expression reconstructs the file path. After using this expression, you should get: Desktop\sayan\cian.pdf.
Step 5 : Use Action inside Loop - Get file content using path
Step 6 :
Use Action inside Loop - Send Email with options
Send Email with options (As I can see that you have to take the Email Id from Excel so in To Section You can Pass the value dynamically directly without spliting)
Attachments : (Value : variables('SplitPath')[sub(variables('Length'),1)] This Expression will help to get the file Name for Example : cian.pdf according to my file path)
ContentBytes : Pass the Variable FilePath
Note: Ensure there are no empty parameters in the Send Email with options action.
Additional Note:
If your file path is not as long as the example path (C:\Users\SayanPatra\OneDrive - XYZ LLC\Desktop\sayan\cian.pdf), you can use the path directly in the Get file content using path action and in the Send Email with options action.
------------------------------------------------------------------------------------------------------------------------------
If my suggestion helped you, please give it a Thumbs up 👍 and Mark it as a Solution 🤖.
Thanks,
Sayan Patra
RPA Developer
Hello @Sayan ,
Thank you very much for your kind help.
I followed your steps and recreated a new flow , however the email could not send this time.
Could you please advise me more about the variables for Name ? (I am not sure what value I should be choose)
and this is the EXCEL file I use.
It provides the following contents and I want to send the emails with the attachments according to this table.
・Email address
・Name
・File path
・File name
Hi @S140
After analysing the workflow, I understand that you are trying to achieve the following:
1. Retrieve an Excel file from the drive.
2. Extract data from a table within the Excel file.
3. Apply an action to each item in the table.
4. Get the file content using its path.
5.Send an email using Outlook with the file content.
First, I have initialized three variables:
After that, I retrieve the table using the action "List Rows Present in a Table." Then, I loop through the body/value, which is the dynamic content of "List Rows Present in a Table."
Next, I extract the file path and split it into an array, because the FilePath contains the full path, which is not valid for the input FilePath of "Get File Content Using Path."
Finally, I use "Send Email with Options" to send the email with attachments.
Note: There should be no empty fields in "Send Email with Options.
If my suggestion helped you, please give it a Thumbs up and Mark it as a Solution so that it can benefit others in the community.
Sayan Patra
RPA Developer
Hi @Sayan , thank you for your suggestion.
Despite there being a message related to fonts, I don't believe it to be a font issue because the original file can be opened without any problem.
It seems more like the PDF file somehow becomes corrupted between Power Automate and Outlook.
Below is a screenshot of the flow (I'm sorry but it is in Japanese as well).
Hey @S140 “After translating the image you attached to English, I get this: 'Adobe Acrobat could not print the document because it was created with a font that is not available on this system. To print this document, install the font that was used when creating it. Please click OK to close this dialog box.”
"My suggestion is, if you are trying to print it, ensure that the font is available on your system. First, install the font."
can you please share the snapshot of the flow or the flow?
If my suggestion helped you, please give it a Thumbs up and Mark it as a Solution so that it can benefit others in the community.
Sayan Patra
RPA Developer
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1