5 Replies Latest reply on Mar 8, 2007 3:51 AM by Pete Muir

    Req: I18N mail function

    Kay Arita Newbie

      Folks

      I'd like to send mail message by seam-mail in Japanese. Mail messages are required the following format in Japan.

      - Message body must be ISO-2022-JP.
      - Subject, from, to (etc.) headers in Japanese must be ISO-2022-JP and be encoded by base64.
      - Content-Type and Content-Transfer-Encoding must be set to charset=ISO-2022-JP and 7bit.

      So, programmers in Japan want to control these headers.

      Thanks in advance.

      --Kay

        • 1. Re: Req: I18N mail function
          Pete Muir Master

          For the message body you *should* be able to just set the encoding as per normal for facelets. I haven't heard this failing but... please test :)

          Can you create a JIRA issue for the headers (a sample mail would be great - attach the plain text source to the issue).

          • 2. Re: Req: I18N mail function
            Kay Arita Newbie

             

            "petemuir" wrote:
            For the message body you *should* be able to just set the encoding as per normal for facelets. I haven't heard this failing but... please test :)


            That's right, but note that Content-Type and Content-Transfer-Encoding fields must be set.

            --Kay

            • 3. Re: Req: I18N mail function
              Pete Muir Master

              I think there is a problem with facelets and changing the charset. Do you have a way that works? We really need to get the facelets guys to fix this otherwise.

              I've double checked, and the headers are set (note that Seam sends out multipart messages so we don't set these parameters in the message header but in the header for the multipart).

              I'm not sure how you change the charset of headers - how do you?

              • 4. Re: Req: I18N mail function
                Kay Arita Newbie

                I'll write the requirements of the mail format in Japan again.

                - Message body must be ISO-2022-JP.
                - Subject, from, to (etc.) headers in Japanese must be ISO-2022-JP and be encoded by base64.
                - Content-Type and Content-Transfer-Encoding must be set to charset=ISO-2022-JP and 7bit.

                So, I made the following message. Content-Type: and Content-Transfer-Encoding: were set by <m:header/>.

                *************************************
                <?xml version="1.0" encoding="ISO-2022-JP"?>
                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
                <m:message xmlns:m="http://jboss.com/products/seam/mail">
                <m:header name="Content-Type" value="text/plain; charset=ISO-2022-JP"/>
                <m:header name="Content-Transfer-Encoding" value="7bit"/>
                <m:from name="???" address="do-not-reply@example.org" />
                <m:to name="#{signUpSession.account.nickname}">#{signUpSession.account.email}</m:to>
                <m:subject>????</m:subject>
                <m:body type="plain">
                ??????#{signUpSession.account.nickname}.
                </m:body>
                </m:message>
                *************************************

                The result was,

                *************************************
                Return-Path: <do-not-reply@example.org>
                Delivered-To: kay@localhost
                Received: from localhost ([127.0.0.1])
                by MacBookPro.local (JAMES SMTP Server 2.3.0) with SMTP ID 681
                for <kay@localhost>;
                Thu, 8 Mar 2007 08:54:06 +0900 (JST)
                Date: Thu, 8 Mar 2007 08:54:06 +0900 (JST)
                From: =?Shift_JIS?B?iseXnY7S?= <do-not-reply@example.org>
                To: =?Shift_JIS?B?gqmCog==?= <kay@localhost>
                Message-ID: <7951494.21173311646222.JavaMail.kay@localhost>
                Subject: ????
                MIME-Version: 1.0
                Content-Type: text/plain; charset=ISO-2022-JP
                Content-Transfer-Encoding: 7bit

                ------=_Part_2_3191081.1173311646221
                Content-Type: text/plain; charset=ISO-8859-1; format=flowed
                Content-Transfer-Encoding: 7bit
                Content-Disposition: inline


                ????????.
                ------=_Part_2_3191081.1173311646221--
                *************************************

                I have some questions and requests.

                1. Why does the result become a multi-part although <m:body type="plain"/> is specified ?
                2. <m:header/> isn't given in the 2nd part though it was in the 1st part.
                3. From: and To: header is encoded by base64 but the character encoding is Shift_JIS (maybe default encoding). These are expected in ISO-2022-JP.
                4. Subject: isn't encoded.

                --Kay

                • 5. Re: Req: I18N mail function
                  Pete Muir Master

                  1) type="plain" tells seam to only produce a plain text mail. Nothing to do with multipart. Seam mail always sends multipart mails.

                  2) What 2nd part? m:header doesn't have any effect on multiparts, only the whole message

                  http://jira.jboss.com/jira/browse/JBSEAM-1006