web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Help needed with SMTP ...
Power Automate
Unanswered

Help needed with SMTP connector (send email v3) and adding an attachment variable

(0) ShareShare
ReportReport
Posted on by

Hello Everyone.

 

I have a flow that works like this:

 

1 - It lists files in a OneDrive folder and gets the file content.

 

ianwuk_0-1683077344872.png


2 - It adds them to an array called Images.

ianwuk_1-1683077401958.png

 

I then want to send an email with those images in the array and I use the SMTP Send Email (v3) action.

In the SMTP connector action, I have for sending an email, I attach the Images array under Attachments.

 

ianwuk_2-1683077447741.png

However, when I run the flow, and it gets to the SMTP action (Send Email V3) it fails, with the error:

 

The 'inputs.parameters' of workflow operation 'Send_Email_(V3)' of type 'OpenApiConnection' is not valid. Error details: The API operation 'SendEmailV3' is missing required property 'emailMessage/Attachments/0/ContentData'.

 

For reference, if I use the Microsoft Outlook Send an email V2 action, and attach the attachments array in the same way then it works without issue.

 

How do I fix this so the email sends with the attached images from the array using the SMTP Send Email (v3) action?

 

Thanks so much for any help!

Categories:
I have the same question (0)
  • CU-19081228-9 Profile Picture
    on at

    An update on this.

     

    I updated my flow to create a new variable for use with the SMTP action with the following parameters:

    ianwuk_1-1683101447709.png

    For ContentData for expression is body('Get_file_content')['$content'].

    I then added this new attachment variable to the SMTP send email action.

    ianwuk_2-1683101498922.png

     

    The SMTP email action now sends the email, with the attachment, except the image files cannot be opened

     

    ianwuk_3-1683101595755.png

     

    Can anyone kindly point me in the right direction to fix this please?

    Thank you so much!

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @ianwuk ,

     

    According to below thread, could you please try and modify ContentType to be emply (" ") then check the result?

    Solved: SMTP connector - send email with attachment - Power Platform Community (microsoft.com)

    {
     "ContentData": @{body('Get_file_content')},
     "ContentType": " ",
     "FileName": @{items('Apply_to_each')?['Name']},
     "ContentId": "1"
     }

     

    Best regards,

  • CU-19081228-9 Profile Picture
    on at

    Thank you for taking the time to reply @v-jefferni 

     

    I updated the contents of the SMTP image array to look like this, making sure ContentType was empty.

     

    ianwuk_0-1683173168240.png

     

    The flow ran, but the end result was the same, the images were in the email, but they could not be opened.

    ianwuk_1-1683173255318.png

     

    Do they have to be decoded or something?

     

    Alternatively, if the images don't work as attachments, how can I then embed the same images in to the email instead?

     

    Any further advice is much appreciated - thank you!!

  • CU-19081228-9 Profile Picture
    on at

    @DamoBird365 I am the guy who left a comment on your YouTube video about the SMTP email action.

     

    I don't suppose you can help with my final piece of this problem?

     

    Thank you so much!

  • tmiller888 Profile Picture
    16 on at

    I can't verify specifically for the Send Email (v3) action, but I have a flow where I use the Send Email (v2) action and a Start and Wait for Approval action.  I found that I need different formats for the attachments array for each of those to work.

     

    For attaching to the approval, I use "Name" and "Content" as the names of the properties.  For attaching to the email, I use "Name" and "ContentBytes" as the names of the properties.  But, the value for Content and ContentBytes is the same: body('Get_attachment_content')

     

    tmiller888_0-1689703608450.png

     

  • Teteriachenko Profile Picture
    6 on at

    You have to extract Media Type with "Get file metadata"

     

    Teteriachenko_1-1712656334640.png

     

    And afterwards images will be showing

    Teteriachenko_2-1712656402878.png

     

     

     

  • PA-user Profile Picture
    4 on at

    The OneDrive version of "get file metadata" doesn't get the files "content data". The output "body" just lists all the properties of the file, not including the data.

  • PA-user Profile Picture
    4 on at

    @ianwuk,

     

    Did you get this problem solved?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 711

#2
Vish WR Profile Picture

Vish WR 691

#3
Haque Profile Picture

Haque 525

Last 30 days Overall leaderboard