Chinese characters shown when sending SMTP mails to hotmail

afarrafarr Member Posts: 287
We have a client who uses NAV 2009 R2, build 32012, with RTC

We use codeunit 400 to send SMTP mail.
The SMTP objects are standard NAV, and the Microsoft.Navision.Mail.dll is the standard version 1.

Some addresses receive the mails without problem, but hotmail addresses see the subject in Chinese, while godaddy addresses even see the body in Chinese.

The client sends emails with HTML in the body, and with a pdf attachment, but the problem occurs even in plain text emails.

Strangely, the problem does not seem to occur when the codeunit is invoked from Classic client.

We tried the fix in KB 2499881 (which includes version 7 of Microsoft.Navision.Mail.dll), although it seems to make things worse, and I now see that there are later fixes at http://support.microsoft.com/kb/2618652

How can we explicitly specify an encoding (e.g. UTF-8) when sending SMTP mail with codeunit 400?

How can we get all available versions of Microsoft.Navision.Mail.dll, or at least the latest version?

Thanks
Alastair Farrugia

Answers

  • ProcatProcat Member Posts: 31
    A quick guess, this might be way off. In codeunit 400 on the OSMail automation, there's an InternetCodepage property that might need to be set differently.
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Maybe it's a bug in the Chinese NSA software. :mrgreen:
  • afarrafarr Member Posts: 287
    Thanks for the suggestions.

    We are not using OSmail automation, so there is no InternetCodePage property.
    We tried 6 different versions of Microsoft.Navision.Mail.dll that MS sent us, but none of them solved the problem.

    The problem occurs both in Classic and RTC; both in plain text mails, and HTML formatted mails, both with and without a pdf attached.

    However, the problem occurs when sending emails from the client server, but not when sending it from our server.

    Do you know what properties of the server (or Exchange server) might influence this?
    Alastair Farrugia
  • vaprogvaprog Member Posts: 1,140
    Hi afarr,

    You have very little options to influence, how the component generates the mime message.

    Before you start searching anywhere in the chain of delivery, I'd suggest to inspect the initially generated message and check whether it is adhering to standards. In a brief test I conducted, I found most significant bits stripped from the message when sendig as text (HtmlFormatted:=FALSE) and also in the text/html mime part of a message with HtmlFormatted:=TRUE. In the latter case,
    Content-Type: text/plain; 
        charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable
    
    was used for the text part, with proper quoting, but in the text only message and the text/html part of the html formatted message, text/plain was used with high bits cleared. In all cases, charset="iso-8859-1" was used.

    So, to be sure to get your text through, you probably best create a HtmlFormatted message, with all non-ascii (ASCII is a 7-bit code) characters encoded as html character entities. Of course, this may not safeguard against mis-behaving mail servers or faulty client software (including web clients).

    BTW: By far the easiest way to inspect sent smtp messages is a tool called smtp4dev, which acts as a local smtp server that receives the messages, but does not forward them but instead lets you have a look at them.
  • afarrafarr Member Posts: 287
    Microsoft have now released (for NAV 2009 R2 and NAV 2013) a hotfix which allows us to set BodyEncoding and SubjectEncoding.
    Choosing UNICODE in both cases solved my problem.
    This is build 35635, but it doesn't show up (yet) on the list of platform hotfixes in Partnersource.
    Alastair Farrugia
  • hawkeyehawkeye Member Posts: 51
    Did you find a solution?
  • afarrafarr Member Posts: 287
    hawkeye wrote: »
    Did you find a solution?

    Microsoft had released (for NAV 2009 R2 and NAV 2013) a hotfix which allowed us to set BodyEncoding and SubjectEncoding.
    Choosing UNICODE for both Body and Subject solved my problem.

    This was build 35635 (I think of NAV 2009R2). The list of platform hotfixes in Partnersource does not list that particular build.

    Build 35678 (of NAV 2009 R2) and 35670 (of NAV 2013), include a fix to the following issue:

    SMTP uses SmtpDeliveryFormat.SevenBit as the DeliveryFormat instead of SmtpDeliveryFormat.International.


    I don't know if it will fix the mentioned issue, but you can try, either with those builds, or with the latest available build from:
    https://mbs.microsoft.com/customersource/uk/NAV/downloads/hot-fixes/NAV2009SP1PlatformHotfixOverview01
    https://mbs2.microsoft.com/Knowledgebase/KBDisplay.aspx?scid=kb;EN-US;2901572

    Alastair Farrugia
  • jigneshdhandhajigneshdhandha Member Posts: 41
    Hello Team,

    I have faced the issue when i received SMTP mail on Mac Client.

    The body of the SMTP email is displayed in Chinese on Macs with the Mac Mail client.

    The subject line and the PDF attachment show in English, only the body of the text shows in Chinese

    The same email sent cc to a PC and a Mac.

    On PC will show English and On Mac will show in Chinese.

    Can anyone help me.

    Thanks
  • vaprogvaprog Member Posts: 1,140
    Have you implemented afarr's solution?
Sign In or Register to comment.