ReplyTo: INetMailAddress;
The ReplyTo property determines the address to which the letter response is sent.
If the property value is not set, by default the response is sent to the sender address.
Sub Main;
Var
ReplyAdress, From_, To_: INetMailAddress;
Message: INetMailMessage;
Attach: INetAttachment;
Client: INetSmtpClient;
Begin
From_ := New NetMailAddress.Create("ivanov@server.ru");
To_ := New NetMailAddress.Create("petrov@mail.ru");
ReplyAdress := New NetMailAddress.Create("user1@mail.ru");
Message := New NetMailMessage.CreateWithFromAndTo(From_, To_);
Message.Subject := "Test letter";
Message.Body := "Letter body";
Message.ReplyTo := ReplyAdress;
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. The response to the letter is forwarded to the user1@mail.ru address.
See also: