Skip to main content
Business Central forum
Answered

How to display special characters (umlaute ä/ö/ü) in a Email?

editSubscribe (0) ShareShare
ReportReport
Posted on by 397 UG Leader

Does anyone have the same issue?

pastedimage1660047874680v1.png

The Email - body is created from a report via Report.SaveAs()

 TempBlobMailBody.CreateOutStream(BodyOutStream);
     Report.SaveAs(MailID, XMLParameters, ReportFormat::Html, BodyOutStream, RecRef);
         TempBlobMailBody.CreateInStream(BodyInStream);
             BodyInStream.ReadText(BodyTxt);

My settings are set to Germany/German...

Thank you.

Tom

  • ZSafar Profile Picture
    ZSafar 10 on at
    RE: How to display special characters (umlaute ä/ö/ü) in a Email?

    Hi Tom,
    tnx for the fast replay.
    I have used the same logic as for the body.
    There is the code:

    ----------------------------------------------------------
    CLEAR(TempBlob);
    TempBlob.WriteAsText(GetSubjectText(EmailDistributionSetupLine,TempDistributionEntry),TEXTENCODING::UTF8);
    TempEmailItem.Subject := GetFormattedDocumentSubjectText(TempBlob);

    --------------------------------------------------------------
    LOCAL GetFormattedDocumentSubjectText(VAR TempBlob : TEMPORARY Record TempBlob) : Text
    IF TempBlob.Blob.HASVALUE THEN BEGIN
    TempBlob.Blob.CREATEINSTREAM(InStr);
    StreamReader := StreamReader.StreamReader(InStr,Encoding.UTF8);
    EXIT(StreamReader.ReadToEnd);
    END;
    ----------------------------------------------------------------
    The funny thing is, it works at the other customer. :-)
    Maybe is the problem in customer mail server setup. I do not know... I asked him and he said that is OK.

    LG Zac

  • T_Mauser Profile Picture
    T_Mauser 397 UG Leader on at
    RE: How to display special characters (umlaute ä/ö/ü) in a Email?

    Hello, I think the subject field is from Typ "Text" - Do you want to use a BLOB-Typ for the subject field?

  • ZSafar Profile Picture
    ZSafar 10 on at
    RE: How to display special characters (umlaute ä/ö/ü) in a Email?

    Hi Tom,

    it works in mail subject (Betreff) to?

    In my case it works in body but not in subject :-(

    Tnx

    Zac

  • Verified answer
    T_Mauser Profile Picture
    T_Mauser 397 UG Leader on at
    RE: How to display special characters (umlaute ä/ö/ü) in a Email?

    Ok, I found the solution:

    You have to use the parameter TextEncoding::UTF8 in the Codeunit "Temp Blob" like this:

    TempBlobMailBody.CreateInStream(BodyInStream, TextEncoding::UTF8);

    Now everything works ;)

    Tom

Helpful resources

Quick Links

What Motivates a Super User?

We know many of you visit the Dynamics 365 Community and Power Platform…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,066 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,585 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Product updates

Dynamics 365 release plans