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

Notifications

Announcements

No record found.

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
    Govinda Kumar Profile Picture
    2,304 Moderator on at
    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!
  • Suggested answer
    Aakib khan Profile Picture
    122 on at
    //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
    Valentin Castravet Profile Picture
    31,428 Super User 2025 Season 2 on at

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,010

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,270 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,085 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans