INetMailMessage.SubjectEncoding

Syntax

SubjectEncoding: CodePage;

Description

The SubjectEncoding property determines the code page used for message subject header encoding.

Example

To execute the example, add a link to the Net system assembly.

Sub UserProc;
Var
    From_, To_: INetMailAddress;
    Message: INetMailMessage;
    Client: INetSmtpClient;
Begin
    From_ := New CurlMailAddress.Create("ivanov@server.ru");
    To_ := New CurlMailAddress.Create("petrov@mail.ru");
    Message := New CurlMailMessage.CreateWithFromAndTo(From_, To_);
    Message.Subject := "Test message";
    Message.Body := "Message text";
    Message.SubjectEncoding := CodePage.KOI8U;
    Message.BodyEncoding := CodePage.KOI8U;
    Client := New CurlSmtpClient.CreateWithHost("example.server.ru");
    Client.Send(Message);
End Sub UserProc;

After executing the example the message is sent via the specified mail server. This message is created considering the sender and the recipient addresses without any copies sending. When sending the message the Cyrillic encoding (KOI8-U) is used for encoding the body and the header of the message.

See also:

INetMailMessage