Good day.
I wrote my SMTP server, it works, but sometimes messages come to it in the format:
Content-Transfer-Encoding: 8bit
Here is the message text itself:
Received: ************************************************ **** ************************************** Sat, 4 Jun 2016 10:48: 34 +0300 (EEST) Date: Sat, 4 Jun 2016 10:48:34 +0300 (EEST) From: from@mail.ru To: to@mail.ru Message-ID: 1354354354354354374354343438434384348448 Subject: MIME-Version: 1.0 Content -Type: text / plain; charset = Windows-1251 Content-Transfer-Encoding: 8bit X-Mailer: ColdFusion 9 Application Server X-MCServiceID: 22 X-SMSPriority: Low
Sample Message ?????? ?????? ??????? ????????? ? - (?????????).
I get the message text through the socket and translate it into text:
Encoding.ASCII.GetString(b) I read that 8bit - Это значение указывает, что данные в теле сообщения содержат знаки, которых нет в кодировке US-ASCII
Maybe this is not a problem with SMTP? Or if he has, how can the question be solved?
Thank.
Encoding.ASCIIdoesn't look like much. You should not guess the encoding (especially since the assumption that it is ASCII is clearly unrealistic: letters may well be, for example, in Russian). Disassemble the letter header (not regular, please), find the correct encoding there (in your case CP1252), and decode the message correctly. - VladD