Hi @Madhu Rao ,
Below design works for me:
Initially called logic app using below PowerShell Script:
$rithfile = "C:\Users\rbojja\Downloads\test.csv"
$attachmentsArray = @(
@{
"Name" = "RithAttachment.csv"
"ContentBytes" = [Convert]::ToBase64String([System.IO.File]::ReadAllBytes($rithfile))
}
)
$rithcon = "https://rithte.azurewebsites.net:443/api/testemailwkflw/triggers/When_a_HTTP_request_is_received/invoke?api-version=2022-05-01&sp=%2Ftriggers%2FWhen_a_HTTP_request_is_received%2Frun&sv=1.0&sig=Q81WrithwikkWZCI"
$rithout = [PSCustomObject]@{
"To" = "******@mit.com"
"Subject" = "Test email attachment"
"Body" = "Hi there! testing email attachments"
"Attachments" = $attachmentsArray
}
$rijson = $rithout | ConvertTo-Json -Depth 5
Invoke-RestMethod -Uri $rithcon -Body $rijson -ContentType 'application/json' -Method POST | Out-Null
Design:
Then:
base64(base64ToBinary(items('For_each')['ContentBytes']))
Code View:
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"For_each": {
"type": "Foreach",
"foreach": "@triggerBody()?['Attachments']",
"actions": {
"Send_an_email_(V2)": {
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"referenceName": "office365"
}
},
"method": "post",
"body": {
"To": "@triggerBody()?['To']",
"Subject": "@triggerBody()?['Subject']",
"Body": "<p class=\"editor-paragraph\">@{triggerBody()?['Body']}</p>",
"Attachments": [
{
"Name": "@items('For_each')['Name']",
"ContentBytes": "@base64(base64ToBinary(items('For_each')['ContentBytes']))"
}
],
"Importance": "Normal"
},
"path": "/v2/Mail"
}
}
},
"runAfter": {}
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"triggers": {
"When_a_HTTP_request_is_received": {
"type": "Request",
"kind": "Http"
}
}
},
"kind": "Stateful"
}
Output:
If this answer was helpful, please click "Accept the answer" and mark Yes, as this can help other community members.

If you have any other questions or are still experiencing issues, feel free to ask in the "comments" section, and I'd be happy to help.