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

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.

I have the same question (0)
  • Suggested answer
    JAngle Profile Picture
    133 on at

    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/.../

  • Suggested answer
    Nitin Verma Profile Picture
    21,708 Moderator on at

    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

  • NeoMatrix Profile Picture
    256 on at

    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.

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 2,238

#2
YUN ZHU Profile Picture

YUN ZHU 773 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 630

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans