Topic
5 replies Latest Post - ‏2013-02-21T13:26:25Z by fjb_saper
sunnytech
sunnytech
11 Posts
ACCEPTED ANSWER

Pinned topic Issue with EmailOutput Node

‏2013-02-05T11:34:50Z |
Hi,

I am trying to send email with Arabic support using WMB 8001. I have tried different CCSID like 1208, 1256, 864 but still no success. The problem I suspect is that bodycontent type that I set (e.g. windows-1256) are reset by EmailOutput node. I am able to send email with this content type 'text/html; windows-1256' using javax mail api but unable to send using broker. Any suggestion ? Thanks
Updated on 2013-02-21T13:26:25Z at 2013-02-21T13:26:25Z by fjb_saper
  • sunnytech
    sunnytech
    11 Posts
    ACCEPTED ANSWER

    Re: Issue with EmailOutput Node

    ‏2013-02-05T12:10:49Z  in response to sunnytech
    Below is the code that I am using:

    DECLARE emailRef REFERENCE TO InputRoot.XMLNSC.EmailNotification;

    SET OutputRoot.BLOB.BLOB = CAST(MsgBody AS BLOB CCSID 1208); -- which contains arabic and english mix contents
    SET OutputLocalEnvironment.Destination.Email.BodyContentType = 'text/html; windows-1256';

    ..

    In EmailOutput node, Body Content Type has 3 options, I am willing not to give anyone but can't do so.

    Setting the same body content type in Java, I am able to send the Arabic in correct format.

    Any suggestions will be highly appreciated. Thanks
  • kimbert@uk.ibm.com
    kimbert@uk.ibm.com
    515 Posts
    ACCEPTED ANSWER

    Re: Issue with EmailOutput Node

    ‏2013-02-05T22:03:15Z  in response to sunnytech
    CCSID 1208 is UTF-8.
    UTF-8 can represent any character in the known universe, so it's a good choice here.
    The other encodings that you mentioned can only represent a restricted subset of Unicode, so are not so good.

    I'm not sure what the problem is with your message flow. What is 'MsgBody'? Is it a CHARACTER variable in your ESQL?
    What exactly is the problem with the email that the flow is sending?
    • sunnytech
      sunnytech
      11 Posts
      ACCEPTED ANSWER

      Re: Issue with EmailOutput Node

      ‏2013-02-06T07:55:14Z  in response to kimbert@uk.ibm.com
      Hi Kimbert,

      Problem is that email is sent successfully but Arabic letters are not in correct format, instead ?????? appears.
      MsgBody is char type field with Arabic and English text.

      Here is the sample text that I am trying to send:

      SET OutputRoot.BLOB.BLOB = CAST('مركز حتا in arabic' as BLOB CCSID 1208);

      The received email has contents like ?????? in arabic.
  • kimbert@uk.ibm.com
    kimbert@uk.ibm.com
    515 Posts
    ACCEPTED ANSWER

    Re: Issue with EmailOutput Node

    ‏2013-02-06T14:15:19Z  in response to sunnytech
    Good - now I understand what your problem is.

    You are using UTF-8 ( CCSID 1208 ) so that is not the problem ( see my previous reply ).
    So I can think of two things that may be happening:
    1. The output is correct, but you are viewing the characters using a program that does not know how to interpret Arabic Unicode characters.
    2. The output from the ASBITSTREAM function is correct( it must be ) but something downstream of the Compute node is changing the bytes.

    The only option now is to examine the bytes of the output message. That will tell you whether it is 1. or 2.
    • fjb_saper
      fjb_saper
      120 Posts
      ACCEPTED ANSWER

      Re: Issue with EmailOutput Node

      ‏2013-02-21T13:26:25Z  in response to kimbert@uk.ibm.com
      I am not sure he is using ASBITSTREAM (see previous post).
      This might well be the problem.
      You cannot cast a message tree to a BLOB or Text.
      You first need to serialize it, hence the call to the ASBITSTREAM function.