INetMailMessage.ReplyTo

Syntax

ReplyTo: INetMailAddress;

Description

The ReplyTo property determines the address, to which the message reply is sent.

Comments

If the property value is not set, by default, the reply is sent to the sender address.

Example

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

Sub UserProc;
Var
    ReplyAdress, From_, To_: INetMailAddress;
    Message: INetMailMessage;
    Attach: INetAttachment;
    Client: INetSmtpClient;
Begin
    From_ := New CurlMailAddress.Create("ivanov@server.ru");
    To_ := New CurlMailAddress.Create("petrov@mail.ru");
    ReplyAdress := New CurlMailAddress.Create("user1@mail.ru");
    Message := New CurlMailMessage.CreateWithFromAndTo(From_, To_);
    Message.Subject := "Test message";
    Message.Body := "Message text";
    Message.ReplyTo := ReplyAdress;
    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. The reply to this message is forwarded to the email user1@mail.ru.

See also:

INetMailMessage