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

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Media Field attach as Email Body or as an attachment

(1) ShareShare
ReportReport
Posted on by 7
Hi All,
I have a created a field of type media in my table and have imported an image in that. Now I want that image to be added to my email Body if possible and if not then i want that to be attached to my email attachment as a separate attachment. Please help me if this is possible in Business Central.
I have the same question (0)
  • Suggested answer
    Valentin Castravet Profile Picture
    28,392 Super User 2025 Season 2 on at
    Media Field attach as Email Body or as an attachment
  • Suggested answer
    Aakib khan Profile Picture
    33 on at
    Media Field attach as Email Body or as an attachment
    //Below code is for making the media or image type of business central into email 
     
    tempblob : codeunit tempblob;
    logo : outstream;
    BULogo : instream;  
     
    tempblob.CreateOutStream(logo);
     
    //To export the media image to an outstream
    //evibusunit.Picture is a field of media type
    evibusunit.Picture.ExportStream(logo);
     
    //Convert it into instream for making it into email body
    tempblob.CreateInStream(BUlogo);
    emailmessage.Create(recipient, Subject, body, true);
    emailmessage.AddAttachment('Logo.png', 'PNG', BUlogo);
    email.Send(emailmessage);
     
    //Now business central image will appear into the email
     
  • Suggested answer
    Govinda Kumar Profile Picture
    2,242 Moderator on at
    Media Field attach as Email Body or as an attachment
    Hi,
    You can attach the image from your media field as an email attachment. Check out this link for code examples on sending emails with attachments.. https://businesscentralgeek.com/5-ways-to-send-an-email-in-business-central take a look at the example where a report is attached to the email.
    Hope that helps!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,678 Super User 2025 Season 2

#2
Sumit Singh Profile Picture

Sumit Singh 2,635

#3
Jeffrey Bulanadi Profile Picture

Jeffrey Bulanadi 2,210

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans