none
Encode Subject for SMTP message RRS feed

  • Question

  • BizTalk SMTP adapter provides option to encode body of email when setting up properties for dynamic send port  like below:

    EmailStringMsg(SMTP.EmailBodyTextCharset) = "iso-8859-1";

    How can I do same thing for Subject? 

    Is there something similar to this:  EmailStringMsg(SMTP.SubjectEncoding) = "iso-8859-1";


    Tuesday, August 22, 2017 4:09 PM

All replies

  • Well at least there is hotfix to disable the subject encoding so I would assume that this bodyencoding affects subject. 

    https://support.microsoft.com/en-us/help/2596691/a-hotfix-adds-an-option-to-let-you-disable-the-encoding-of-the-subject


    -Janne

    Wednesday, August 23, 2017 5:36 AM
  • You need a more sofisticated adapter to utilize all smtp headers/properties
    I am not sure even nsoftwares adapter can do the trick

    What are the requirements?

    Wednesday, August 23, 2017 7:22 AM
  • Peter,

    Requirement is to encode subject as "iso-8859-1" instead of default ?utf8?B

    Wednesday, August 23, 2017 2:06 PM
  • Yes standard encoding is UTF8
    Quick test on BTS 2013

    thread-index: AdMcG4onYhrh8COJQKiKvdGQr9/yUA==
    Thread-Topic: =?utf-8?B?VGVzdA==?=
    From: <plyk@localhost>
    To: <plyk@localhost>
    Cc: 
    Subject: =?utf-8?B?VGVzdA==?=
    Date: Wed, 23 Aug 2017 16:24:33 +0200
    Message-ID: <6CC042400B9D4E0EA37962A2F2BADF43@localhost>
    MIME-Version: 1.0
    Content-Type: multipart/mixed;
    	boundary="----=_NextPart_000_0005_01D31C2C.4DB1E800"
    X-Mailer: Microsoft CDO for Windows 2000
    Content-Class: urn:content-classes:message
    Importance: normal
    Priority: normal
    X-MimeOLE: Produced By Microsoft MimeOLE


    It's been a while since mailservers did not support the above headers
    Example on conversion
    http://dogmamix.com/MimeHeadersDecoder/

    Makes me wonder why you want to make your life more difficult?

    /Peter



    Wednesday, August 23, 2017 2:33 PM
  • Requirement is to encode subject as "iso-8859-1" instead of default ?utf8?B

    Are you saying that the Subject and Body should have different encodings? That would be highly unusual and something to triple confirm with the receiver.
    Wednesday, August 23, 2017 3:20 PM
  • Both body and subject needs iso-8859-1 encoding, it can be done for body but not for subject with current BTS SMTP Adapter as I see it

    /Peter

    Wednesday, August 23, 2017 4:40 PM
  • As noted above, if you have BizTalk Server 2010 CU2 or later, then the specified encoding should apply to the entire message, including the Subject:.

    Is the Receiver saying something else?  Or are they requiring that the Subject: be explicitly encoded even if the same as the Body?  That would be somewhat unusual.

    Wednesday, August 23, 2017 6:14 PM
  • Not if you use a static smtp port (BTS 2013)

    thread-index: AdMcUJFQiUHXEp1ZSaqLwkebDTlDMg==
    Thread-Topic: =?utf-8?B?VGVzdA==?=
    From: <plyk@localhost>
    To: <plyk@localhost>
    Cc: 
    Subject: =?utf-8?B?VGVzdA==?=
    Date: Wed, 23 Aug 2017 22:44:08 +0200
    Message-ID: <413958AE7C71403EB902BAB782FB3464@local>
    MIME-Version: 1.0
    Content-Type: text/plain;
    	charset="iso-8859-1"
    Content-Transfer-Encoding: 7bit
    X-Mailer: Microsoft CDO for Windows 2000
    Content-Class: urn:content-classes:message
    Importance: normal
    Priority: normal
    X-MimeOLE: Produced By Microsoft MimeOLE
    
    Test

    /Peter

    Wednesday, August 23, 2017 8:47 PM
  • @BoatSeller

    It does not apply same. Body goes out as ISO when I assign it in Orch in SMTP properties, while subject stays UTF-8 with base 64.

    @Peter

    Makes me wonder why you want to make your life more difficult?

    utf-8 with base64 breaks at some old web servers on client side when subject length exceeds 180 characters. That is driving this whole need as I can not simply ask clients to upgrade their email web servers.

    As a workaround, I have written pipeline component which uses .NET mail message to route directly and not use SMTP adapter.

    Note: In Mail Message, we have option to define encoding for both subject and body.

    Thanks for your inputs.

    Thursday, August 24, 2017 6:41 PM