Why did not subject display normal except English words(like Chinese)

Giganews Newsgroups
Subject: Why did not subject display normal except English words(like Chinese)
Posted by:  kylework2010 (kylework20…@163.com)
Date: Thu, 23 Oct 2008

Hi,
    First,I'm apologized for my English poor.I used D2009 with Indy =
10,the email subject does not displaying normal.Please help.

There are some source code:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
//--3.=B7=A2=CB=CDHTML=B8=F1=CA=BD=D3=CA=BC=FE=A3=AC=CE=DE=B8=BD=BC=FE
procedure TfrmMessageEditor.SendSimpleMailt(Recipient, Address: string);
var
  AdressItem: TIdEMailAddressItem;
  AMessage: TIdMessage;
  ASMTP: TIdSMTP;
  IdHTML: TIdText;
begin
  AMessage :=3D TIdMessage.Create(nil);
  AMessage.NoDecode :=3D False;
  AMessage.NoEncode :=3D False;
  AMessage.CharSet :=3D 'GB2312';
  AMessage.Encoding :=3D meMIME;
  AdressItem :=3D AMessage.Recipients.Add;
  AdressItem.Name :=3D Recipient;
  AdressItem.Address :=3D Address;
  AMessage.Subject :=3D 'Hello.=F6=A6=C5=AE!';
  AMessage.Sender.Name :=3D 'Terranceluo';
  AMessage.Sender.Address :=3D 'terran…@163.com';
  AMessage.From.Name :=3D AMessage.Sender.Name;
  AMessage.From.Address :=3D AMessage.Sender.Address;

  IdHTML :=3D TIdText.Create(AMessage.MessageParts, nil);
  IdHTML.ContentType :=3D 'text/html;charset=3DGB2312';
  IdHTML.ContentTransfer :=3D 'base64';
  IdHTML.ParentPart :=3D 0;
  IdHTML.Body.Add('<html>');
  IdHTML.Body.Add('<head>');
  IdHTML.Body.Add('<title>Hello,=F6=A6=C5=AE</title>');
  IdHTML.Body.Add('</head>');
  IdHTML.Body.Add('<body =
title=3D"=B2=E2=CA=D4HTML=B8=F1=CA=BD=B5=C4=D3=CA=BC=FE=D5=FD=CE=C4">');
  IdHTML.Body.Add('<table width=3D"100%" border=3D"0" cellpadding=3D"3" =
cellspacing=3D"1" bgcolor=3D"#5E5E56">');
  IdHTML.Body.Add('  <tr bgcolor=3D"#D2FFD2">');
  IdHTML.Body.Add('    <td align=3D"left">');
  IdHTML.Body.Add('      <font size=3D5>Hello, Terrance.<br>');
  =
IdHTML.Body.Add('=B8=C3=D3=CA=BC=FE=D5=FD=CE=C4=CA=C7HTML=B8=F1=CA=BD=A3=AC=
=B8=BD=BC=FE=D3=EB=D5=FD=CE=C4HTML=CE=DE=B9=D8=C1=AA=D0=D4=A3=A1<br>');
  =
IdHTML.Body.Add('=B2=E2=CA=D4=D3=CA=BC=FE=A3=AC=BF=B4=BF=B4=C4=DC=B2=BB=C4=
=DC=CF=D4=CA=BE=D6=D0=CE=C4=A3=A1<br>');
  IdHTML.Body.Add(FormatDateTime('yyyy-mm-dd hh:mm:ss', Now));
  IdHTML.Body.Add('      </font>');
  IdHTML.Body.Add('    </td>');
  IdHTML.Body.Add('  </tr>');
  IdHTML.Body.Add('</table>');
  IdHTML.Body.Add('</body>');
  IdHTML.Body.Add('</html>');

  AMessage.ContentType :=3D 'text/html';
  AMessage.ContentTransferEncoding :=3D 'base64';
  Screen.Cursor :=3D crHourGlass;
  ASMTP :=3D TIdSMTP.Create(nil);
  try
    ASMTP.Host :=3D 'smtp.163.com';
    ASMTP.Username :=3D 'terrance';
    ASMTP.Password :=3D '******';
    ASMTP.Port :=3D 25;
    ASMTP.Connect;
    try
      ASMTP.Send(AMessage);
    except
      on E: Exception do
        ShowMessageFmt('Error:%s', [E.Message]);
    end;
    ASMTP.Disconnect;
  finally;
    Screen.Cursor :=3D crDefault;
    AMessage.Free;
    ASMTP.Free;
  end;
end;
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Call procedure source code:
procedure TfrmMessageEditor.Button4Click(Sender: TObject);
begin
  SendSimpleMailt('test','lkwo…@163.com');
end;

The mail can send normal,and the body displayed normal,but the subject =
could not.If the subject with only English words,it can display normal.I =
don't know why.

The attachments is the picture with source code and the mail example.

Why did not subject display normal except English words?Please help.

Thanks a lots!

Terrance

Oct 23.2008

Replies