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 / Bulk Email Trigger Flow
Power Automate
Answered

Bulk Email Trigger Flow

(1) ShareShare
ReportReport
Posted on by

I would like to place a PNG image in the body of the email, but when the provider is GMAIL the image goes as an attachment and not in the body, could anyone help me.

Below is evidence of my flow


Sem título.png

 

 

I have the same question (0)
  • VishnuReddy1997 Profile Picture
    2,666 Super User 2026 Season 1 on at

    Hi @Santiago01Br_ ,

     

    Apart from attaching images to emails, Power Automate allows you to embed images to email bodies using HTML.

     

    To embed an image, check the Body is HTML option in the appropriate email action and populate the Body field with the following code.

    VishnuReddy1997_0-1720698308371.png

     

    HTML Code:

    Change the Image url in the code

    <html>
     <body>
     <h1>Title</h1>
     <p>This is a paragraph.</p>
     <img src="image-url">
     </body>
    </html>

     

    (Note:- if you got your solution you can mark as solution and gives kudos)


    Thanks & Regards

    Vishnu Reddy

  • CU24071140-1 Profile Picture
    on at

    Thank you for your help!

    However, following the instructions you mentioned, the image arrives in my Gmail as shown in the screenshot below:

    Do you know what I can do to make it appear as an image?

    Sem título.png

     

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

    Hi @Santiago01Br_ 

     

    Go with below .Net script:

     

    Please first test it then replaces all hardcoded values with dynamic variables

    Deenuji_0-1720701965302.png

     

     

     

    Output:

    Deenuji_1-1720701966013.png

     

    Flow code(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 👩‍💻
    Power Automate Desktop Community Champion 🤖
    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 🚀

  • VishnuReddy1997 Profile Picture
    2,666 Super User 2026 Season 1 on at

    Hi @Santiago01Br_ ,

     

    Try this Vbscript using Run VBScript action.

     

    VbScript Code:

    Dim objOutlook
    Dim objMail
    Dim strHTMLBody
    Dim objAttach
    
    ' Create the Outlook application object
    Set objOutlook = CreateObject("Outlook.Application")
    
    ' Create a new email
    Set objMail = objOutlook.CreateItem(0) ' 0 represents a Mail item
    
    ' Set the recipient email address
    objMail.To = "vishnureddy6569@gmail.com"
    
    ' Set the subject of the email
    objMail.Subject = "Subject of the Email"
    
    ' Define the HTML body with an embedded image
    strHTMLBody = "<html><body>" & _
     "<p>Dear User,</p>" & _
     "<p>Here is the image you requested:</p>" & _
     "<img src='cid:ImageID'>" & _
     "<p>Best regards,<br>Your Name</p>" & _
     "</body></html>"
    
    ' Set the HTML body of the email
    objMail.HTMLBody = strHTMLBody
    
    ' Attach the image and set its Content-ID
    Set objAttach = objMail.Attachments.Add("C:\Users\Desktop\Mail.png")
    objAttach.PropertyAccessor.SetProperty "http://schemas.microsoft.com/mapi/proptag/0x3712001F", "ImageID"
    
    ' Send the email
    objMail.Send
    
    ' Clean up
    Set objAttach = Nothing
    Set objMail = Nothing
    Set objOutlook = Nothing

     

    (Note:- if you got your solution you can mark as solution and gives kudos)


    Thanks & Regards

    Vishnu Reddy

  • CU24071140-1 Profile Picture
    on at

    Hello VishnuReddy1997, thank you very much, it worked really well, one question would it be possible for me to put a variable in "objMail.To" because I would like to pull a column from Excel where the emails are listed.

  • Verified answer
    VishnuReddy1997 Profile Picture
    2,666 Super User 2026 Season 1 on at

    Hi @Santiago01Br_ ,

     

    Yes its possible just replace the mail id with the variable.

     

    (Note:- if you got your solution you can mark as solution and gives kudos)


    Thanks & Regards

    Vishnu Reddy

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 252 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard