Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Answered

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

Posted on by 397 User Group 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 User Group 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 User Group 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

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,524 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,493 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans