2

I need to send an email with the Subject containing cyrillic letters. But my recipients sometimes receive incorrect letters due to some problems with mail server and/or client. I always send emails in windows-1251 encoding, but sometimes a mail client shows letter's Subject and Sender in another encoding (KOI-8R) and our users can't understand the message. I tried to use an encoded-word tag as described in RFC 2047 Standard. For example, my Subject field in the email now looks like:

Subject: =?WINDOWS-1251?B?wiDt5eTw4PUg8vPt5PD7IOL75PD7IOIg4+Xy8OD1IPL78P/yIOIg4uXk8OAg/+Tw?=
=?WINDOWS-1251?B?4CDq5eTw4C4gwvvw4uDiIPEg4vvk8Psg4iDy8+3k8OUg4+Xy?=
=?WINDOWS-1251?B?8PssIOL78vDzIOL75PDu6SD/5PDgIOrl5PDgLCDi+/Lw8yDj?=
=?WINDOWS-1251?B?5fLw7ukg4vvk8OUg7O7w5PMsIP/k8OAg4iDi5eTw4Cwg4vvk?=
=?WINDOWS-1251?B?8PMg4iDy8+3k8PMu?=

These lines was generated by Oracle function UTL_ENCODE.MIMEHEADER_ENCODE.

All mail clients (Lotus Notes, gmail.com) show only the first line of such email subject (only first 48 symbols). What is the problem with my mail subject?

4

1 回答 1

5

问题是,根据 RFC 2822,您没有正确折叠。要在标题中创建多行字段,每行必须以空格开头。

你需要做的是:

replace(UTL_ENCODE.MIMEHEADER_ENCODE(subject, 'UTF8', UTL_ENCODE.BASE64), UTL_TCP.CRLF, UTL_TCP.CRLF || ' ')

这应该可以解决您的问题。

于 2014-08-12T14:46:29.847 回答