Hello, I have a requirement to send a notification email which may have unicode content. e.g. Country name like México - please note the accent over 'e'.
The country names are stored in a DB2 table in Unicode. Cobol is also equipped to handle unicode characters. I am creating an email with the Unicode message as an attachment. The email is getting generated with an *.RTF attachment. However, when I open the attachment the unicode based text becomes garbled. I have tried using every avaialble encoding option in word to open the attachmemnt but I always see garbage.
I am using IEBGENER to create email with attachment. I have tried out every possible option of content type, charset and content transfer encoding to no avail. Please help...
MAIL FROM: <ABCD@XXXX.COM>
RCPT TO: <ABCD@XXXX.COM>
SUBJECT: TEST : TEST FILE
Hello This is Amrish
<== Line in unicode containing word "México"
I work for ABC INC
yes, looked at the output with a hex editor. Surprisingly the attachment is in ASCII. e.g. The word "Hello" was in EBCDIC, which I was able to confim by looking at the input PS with HEX ON. Then the attachement in the email, still has the word "Hello" in a readable format. In a HEX editor, the word "Hello" is represented in ASCII. But the word "México" is also getting translated into something that is garbage...
Joined: 06 Jun 2008 Posts: 8491 Location: Dubuque, Iowa, USA
In a HEX editor, the word "Hello" is represented in ASCII. But the word "México" is also getting translated into something that is garbage
The timing might be difficult to get right, but when you send an email via SMTP on the mainframe, SMTP makes a copy of the message until it gets sent. The HLQ of the data sets depends upon your site standards, but the low-level qualifiers will be ADDRBLOK and NOTE for the address information and the actual SMTP text. Submit your job, then look at the NOTE to see what z/OS is actually sending. If you have trouble seeing the files on your system, send the email to a non-existent address so SMTP will keep the data around (the files are only deleted when the mail server indicates the mail has been transmitted). Contact your site support group to find out the HLQ for the data sets.
How are you creating your EMAIL.TEXT1 file? Unless it is entirely created by your COBOL program, you may have a mix of EBCDIC and UTF-8 data in the file.