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 / How to add image in gm...
Power Automate
Answered

How to add image in gmail body from local storage, PAD?

(0) ShareShare
ReportReport
Posted on by 357

Hi Team,
I want to add image in gmail body , image is taking from local system,
i have tried couple of ways but not get the solution, Image getting currupt means not show in body.
Please let me know if you have any solution on it, It would be appreciated.

Thanks in advance.

I have the same question (0)
  • CU16071609-1 Profile Picture
    6,255 Moderator on at

    @Sanket1 

     

    Are you using outlook package to send an email or using different options?

    Any screenshot of your flow would be appreciated 

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

  • Srini007 Profile Picture
    3,490 Super User 2026 Season 1 on at

    Hi @Sanket1 

     

    Check below link for your reference

     

    https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/How-to-embed-an-image-in-Outlook-email-body-in-Power-Automate/td-p/1592069

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Cheers,

    Srini

  • CU16071609-1 Profile Picture
    6,255 Moderator on at

    @Sanket1 

     

    This is typical way of doing:

    Deenuji_0-1716200807027.png

     

     

    Outlook send items:

    Deenuji_1-1716200913099.png

     

     

    Gmail Inbox:

    Deenuji_2-1716200975289.png

     

     

    Its showing embedded images in outlook correctly but when we open the same email in gmail its showing as attachments 🙂 funny 

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

     

  • Verified answer
    CU16071609-1 Profile Picture
    6,255 Moderator on at

    @Sanket1 

     

    Go with below .Net scripting:

     

    Please first test it and remove all hardcoded values with dynamic variables

    Deenuji_0-1716202242015.png

     

     

    Output:

    Deenuji_1-1716202347947.png

     

     

    Flow code(not .Net script code - So just copy and paste it in PAD):

     

    Scripting.RunDotNetScript Imports: $''' System.Net
     System.Net.Mail''' Language: System.DotNetActionLanguageType.CSharp Script: $'''// Sender and recipient email addresses
    string senderEmail = \"deenu@microsoft.com\";
    string recipientEmail = \"deenu@gmail.com\";
    
    // Create a new MailMessage
    MailMessage mail = new MailMessage(senderEmail, recipientEmail);
    mail.Subject = \"Embedded Image in Email\";
    
    // Read image files from local system and attach them to the email
    Attachment image1 = new Attachment(\"C:\\\\Boot\\\\Email.png\");
    image1.ContentId = \"image1\";
    mail.Attachments.Add(image1);
    
    
    // Create HTML content with CID URLs referencing the attached images
    string htmlBody = @\"
     <html>
     <body>
     <h2>Embedded Images</h2>
     <p>This email contains embedded images:</p>
     <img src=\'cid:image1\' alt=\'Image 1\'>
    
     </body>
     </html>\";
    mail.IsBodyHtml = true;
    mail.Body = htmlBody;
    
    // Configure SMTP client and send email
    SmtpClient smtpClient = new SmtpClient(\"smtp.office365.com\", 587);
    smtpClient.Credentials = new NetworkCredential(\"deenu@microsoft.com\", \"Password\");
    smtpClient.EnableSsl = true;
    smtpClient.Send(mail);
    
    // Dispose attachments and client
    image1.Dispose();
    
    smtpClient.Dispose();'''


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

  • Sanket1 Profile Picture
    357 on at

    Its working,
    Thank you so much @Deenuji Sir.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 253 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 172 Super User 2026 Season 2

#3
trice602 Profile Picture

trice602 134 Super User 2026 Season 2

Last 30 days Overall leaderboard