SubjectEncoding: CodePage;
The SubjectEncoding property determines the code page used for the letterhead coding.
Sub Main;
Var
From_, To_: INetMailAddress;
Message: INetMailMessage;
Client: INetSmtpClient;
Begin
From_ := New NetMailAddress.Create("ivanov@server.ru");
To_ := New NetMailAddress.Create("petrov@mail.ru");
Message := New NetMailMessage.CreateWithFromAndTo(From_, To_);
Message.Subject := "Test letter";
Message.Body := "Letter body";
Message.SubjectEncoding := CodePage.KOI8U;
Message.BodyEncoding := CodePage.KOI8U;
Client := New NetSmtpClient.CreateWithHost("example.server.ru");
Client.Send(Message);
End Sub Main;
After executing the example a letter is sent via the specified mail server. The letter is created considering the sender and the recipient addresses without any copies sending. When sending the letter the Cyrillic coding (KOI8-U) is used for coding the body and the header of the letter.
See also: