Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Nov : Re: Sending a SMTP message with UTF-8 subject

www.cryer.info
Managed Newsgroup Archive

Re: Sending a SMTP message with UTF-8 subject

Subject:Re: Sending a SMTP message with UTF-8 subject
Posted by:"Richard" (ritchie8..@yahoo.com)
Date:Mon, 26 Nov 2007 23:42:48

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:474b0c8b$1@newsgroups.borland.com...
>
> Please show the actual raw data.
>

Well, my code is (rawly) the following (SMTP is TidFTP and Mess is
TidMessage)

    SMTP.Host:= 'myftp';
    SMTP.Port:= 25;

    Mess.Encoding:= meMIME;
    Mess.CharSet:= 'utf-8';
    Mess.ContentTransferEncoding:= '8bit';

   Mess.Subject:= UTF8Encode( SomeWideString)) ;
   Mess.From.Name:= UTF8Encode('SomeWideString');
   Mess.From.Address:= 'someaddress';
   Mess.Recipients.EMailAddresses:= 'someaddress';
   Mess.Subject:= UTF8Encode('SomeWideString');

  Mess.Body.Text:= UTF8Encode('Some whide string');

When the message is received, the body looks OK with all 3 languages on it.
The raw message shows that the body has been UTFed (in my code) AND it's
interpreted well.

The subject OTOH looks rawly like:

?utf-8?B?w5HCi8OQwrLDkMK6w5HCi8OQwrA=?=

so it SEEMS like it has been base64 encoded, BUT, if I first base64 decode
it and then I  UTF8Decode I don't get my original widestring......So that's
why I was wondering if maybe the headers get UTF8 encoded automatically or
something....

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive