Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Nov : Mailsubject with German umlauts

www.cryer.info
Managed Newsgroup Archive

Mailsubject with German umlauts

Subject:Mailsubject with German umlauts
Posted by:"Arne" (arne.wuerzba..@grid-data.com)
Date:28 Nov 2006 06:03:04

Hello,

I have a little problem. I want to send Mails, which have
German umlauts in their subjects.
But when I use umlauts the subject will be changed
automatically in a strange way. After changing the subject
the subject contains only the word with the umlaut...

example:
oroginal subject: "Mail to Mr Müller"
changed subject : "M|ller"

Does anybody know how to fix this?

I use the following code to send mails:


  Msg := TidMessage.Create(nil);
  With Msg Do
    Begin
      From.Address := SMTPFromAddress;
      From.Text := SMTPReplyTo;
      FROM.Name := SMTPFromname;
      Recipients.EMailAddresses := Adressen[Index].Mailadresse;
      Subject := mysubject;  // this may contain german "Umlaute"
                             // [A$A?A?A"A-AoAY]
      Body.Text := mybody;
      ReceiptRecipient.Text := '';
      CASE Mailtyp of
      0 : ContentType := 'text/html';
      1 : ContentType := 'text/plain';
      Else
        ContentType := 'text/plain';
      End; // of CASE
    End;
  If Attachments.Count > 0
    then
      For I := 0 To Attachments.Count -1 DO
        TIDAttachment.Create(Msg.Messageparts,Attachments[I]);

  SMTP := TidSMTP.Create(nil);
  SMTP.Port := SmtpServerPort;
  CASE SmtpAuthType of
    0 :  SMTP.AuthenticationType := atNone;
    1 :  SMTP.AuthenticationType := atLogin;
  END;
  SMTP.UserId := SmtpUserID;
  SMTP.Password := SmtpServerPassword;
  SMTP.Host := SmtpServerName;
  try
    try
      SMTP.Connect;
      SMTP.Send(Msg);
    except
      on e : exception do
        Begin
          log(ThreadID,e.message);
          Fehler := True;
        End;
    end;
  finally
    SMTP.Disconnect;
    FreeAndNil(SMTP);
    FreeAndNil(Msg);
  end;


Thanks for your help!

Arne

Replies:

www.cryer.info
Managed Newsgroup Archive