Link to home
Start Free TrialLog in
Avatar of mhanefitel
mhanefitelFlag for Türkiye

asked on

Turkish Language character problem when sending e-mail using indy 10

Hi,
    Below is the code Delphi BDS 2006 Indy 10. When i send e-mail using Turkish language character i get incorrect wiew on e-mail client side.

On MS Outlook 2007 :

Subjet : ýýýý ÜÜÜ ÞÞÞ ÇÇÇ ÝÝÝ ÐÐÐ ÖÖÖ ööö ððð ççç þþþ
Body : iiii ÜÜÜ SSS ÇÇÇ III GGG ÖÖÖ ööö ggg ççç sss

On Yahoo :
Subject : ýýýý ÜÜÜ ÞÞÞ ÇÇÇ ÝÝÝ ÐÐÐ ÖÖÖ ööö ððð ççç þþþ (incorrect view)
Body : ¿¿¿¿ ¿¿¿ ¿¿¿ ¿¿¿ ¿¿¿ ¿¿¿ ¿¿¿ ¿¿¿ ¿¿¿ ¿¿¿ ¿¿¿  (incorrect view)

     How can i fix this problem? I want to send e-mail using Turkish language character and make sure that my e-mail is viewed on client side correctly.(correct Turkish language character are attached on jpeg file. )
     Thanks in advance.




 
procedure TForm1.Button1Click(Sender: TObject);
var Temp : String;
   mailMessage : TIdMessage;
   SMTPConnection : TIdSMTP;
   tempCharSet : String;
   tempEncoding : char;
   tempTransfer : TTransfer;
begin
  Screen.Cursor := crHourGlass;//mouse bekleme

  try
      mailMessage    := TIdMessage.Create;
      SMTPConnection := TIdSMTP.Create;

      mailMessage.ClearHeader;

   //   tempCharSet  := 'ISO-8859-9';
     // tempEncoding := 'B';
    //  tempTransfer := bit8;
    //  mailMessage.InitializeISO(tempTransfer,tempEncoding,tempCharSet);

      mailMessage.ContentTransferEncoding := '8bit';
      mailMessage.CharSet                 := 'ISO-8859-9';


      with mailMessage do
      begin
         Clear;
         From.Text                 := _fromEMail;
         From.Name                 := _fromName;
         ReplyTo.EMailAddresses    := '';
         Priority                  := mpNormal;
         Recipients.EMailAddresses := _toEMail;
         Subject                   := 'iiii ÜÜÜ SSS ÇÇÇ III GGG ÖÖÖ ööö ggg ççç sss';
      end;
      mailMessage.Body.Clear;
      mailMessage.ContentType := 'text/html';
      mailMessage.Body.Add('<html>');
      mailMessage.Body.Add('<head></head>');
      mailMessage.Body.Add('<body>');
      TEMP := mailMessage.Subject;
      mailMessage.Body.Add(TEMP);
      mailMessage.Body.Add('</body>');
      mailMessage.Body.Add('</html>');


      SMTPConnection.Username := _userName;
      SMTPConnection.Password := _userPass;
      SMTPConnection.Host     := _serverName;
      SMTPConnection.Port     := _serverPort;

      {now we send the message}
      SMTPConnection.Connect;
      try
         SMTPConnection.Send(mailMessage);
      finally
         SMTPConnection.Disconnect;
      end;
  finally
      SMTPConnection.Free;
      mailMessage.Free;
  end;
  Screen.Cursor := crDefault;//mosue normal
end;

Open in new window

CorrectCharacters.jpg
Avatar of davizinx
davizinx
Flag of Brazil image

try this:

ISO/IEC 8859-3
Avatar of mhanefitel

ASKER

ISO/IEC 8859-3 solution does not work.
ASKER CERTIFIED SOLUTION
Avatar of mhanefitel
mhanefitel
Flag of Türkiye image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I solved problem myself.