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

Outlook not showing image From email accounts send email - Business central Cloud

(0) ShareShare
ReportReport
Posted on by 256

Hi All,

I am trying to send image in email body with below email account code.

pageextension 50140 CustomerEmailBody extends "Customer List"
{
    actions
    {
        addafter("&Customer")
        {
            action(EmailBodyImage)
            {
                ApplicationArea = All;
                PromotedCategory = Process;
                PromotedIsBig = true;
                Promoted = true;
                trigger OnAction()
                var
                    ComInfo: Record "Company Information";
                    Convert: Codeunit "Base64 Convert";
                    EmailMessage: Codeunit "Email Message";
                    Email: Codeunit Email;
                    InStreams: InStream;
                    ImageVal: Text;
                    ToReceipent: List of [Text];
                    BCCRecipients: List of [Text];
                    CCRecipients: List of [Text];
                    OrderEmailBody: Text;
                begin
                    ComInfo.CalcFields(Picture);
                    if ComInfo.Picture.HasValue then begin
                        ComInfo.Picture.CreateInStream(InStreams, TextEncoding::UTF8);
                        ImageVal := Convert.ToBase64(InStreams);
                        Message(ImageVal);
                        ToReceipent.Add('demo@gmail.com');
                        Clear(OrderEmailBody);

                        OrderEmailBody := 'Hi,'
                          'CompanyLogo';
                        Message(OrderEmailBody);
                        EmailMessage.Create(ToReceipent, 'Email Image From Company Info', OrderEmailBody, true, CCRecipients, BCCRecipients);
                        //  Email.OpenInEditor(EmailMessage, Enum::"Email Scenario"::Default);
                        if Email.Send(EmailMessage) then
                            Message('Email send');
                    end;
                end;

            }
        }
    }
}

But it shows the Outlook in Cross sign.

pastedimage1657520224012v1.png

Please help how to solve this issue.

  • NeoMatrix Profile Picture
    256 on at
    RE: Outlook not showing image From email accounts send email - Business central Cloud

    Thanks for Reply. [tag:Josh] & # Nitin . I have create report using word layout. it is working well. but the previous code using SMTP mail it showing the image in outlook. so what the difference SMTP Code vs Email Account . it should work on both. because we need to crate on object report.

  • Suggested answer
    Nitin Verma Profile Picture
    21,569 Moderator on at
    RE: Outlook not showing image From email accounts send email - Business central Cloud

    Hi NeoMatrix,

    I will suggest you go with the .Docx file as Report in the Email body,

    Please refer the below link

    business-central.to-increase.com/.../ui-how-send-documents-email

  • Suggested answer
    JAngle Profile Picture
    95 on at
    RE: Outlook not showing image From email accounts send email - Business central Cloud

    Might be doable the way you’re trying. In standard the usage of word layouts seems more common. You can then convert that to html. This video might help: https://youtu.be/zrJXze8zwT0

    or read this, has a link to code. I do a conversion of a word doc to html: joshanglesea.wordpress.com/.../

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans