08-24-2018, 10:28 AM
I use Embarcadero C++Builder 10.2 Tokyo with Indy 10.
The task is to check emails via POP3. I can get emails, but I don't know how to decode their subjects, attachment file name, etc from koi8-r to windows-1251 or UTF-8.
Can anybody help me?
The task is to check emails via POP3. I can get emails, but I don't know how to decode their subjects, attachment file name, etc from koi8-r to windows-1251 or UTF-8.
Can anybody help me?
Code:
Return-path: <babichev@meccanosoft.com>
Envelope-to: ear@meccanosoft.com
Delivery-date: Thu, 12 Jul 2018 14:00:33 +0300
Received: from [213.79.95.226] (helo=pccomerc)
by server120.hosting.reg.ru with esmtpa (Exim 4.90_1)
(envelope-from <babichev@meccanosoft.com>)
id 1fdZKr-0002FS-1c
for ear@meccanosoft.com; Thu, 12 Jul 2018 14:00:33 +0300
From: =?KOI8-R?B?4sHCyd7F1yDzxdLHxco=?= <babichev@meccanosoft.com>
To: ear@meccanosoft.com
Subject: test8
Date: Thu, 12 Jul 2018 14:00:29 +0300
Message-Id: <006901d419cf$8e2aeed0$aa80cc70$@meccanosoft.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="UMwhv1yjwbAJnDKFK8wyCH0CYSe2=_553g"
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AdQZz4RBq8MEckA1Rq6W+ide2hSKlw==
Content-Language: ru
In-Reply-To: <006901d419cf$8e2aeed0$aa80cc70$@meccanosoft.com>
This is a multipart message in MIME format.
--UMwhv1yjwbAJnDKFK8wyCH0CYSe2=_553g
Content-Type: multipart/alternative;
boundary="jEgWjeMCC35bF=_m8mr8EoHknZfRtWVKzB"
--jEgWjeMCC35bF=_m8mr8EoHknZfRtWVKzB
Content-Type: text/plain; charset="koi8-r"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
TEST8
--jEgWjeMCC35bF=_m8mr8EoHknZfRtWVKzB
Content-Type: text/html; charset="koi8-r"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas=
-microsoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:off=
ice:word" xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml"=
xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta http-equiv=3DCo=
ntent-Type content=3D"text/html; charset=3Dkoi8-r"><meta name=3DGenera=
tor content=3D"Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
=2EMsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:2.0cm 42.5pt 2.0cm 3.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DRU link=3D"#0563=
C1" vlink=3D"#954F72"><div class=3DWordSection1><p class=3DMsoNormal><=
span lang=3DEN-US>TEST8<o:p></o:p></span></p></div></body></html>
--jEgWjeMCC35bF=_m8mr8EoHknZfRtWVKzB--
--UMwhv1yjwbAJnDKFK8wyCH0CYSe2=_553g
Content-Type: text/plain;
name="=?KOI8-R?B?0M/e1MExLnR4dA==?="
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="=?KOI8-R?B?0M/e1MExLnR4dA==?="
................................................
--UMwhv1yjwbAJnDKFK8wyCH0CYSe2=_553g--
`