Skip to main content

ReplyTo

property ReplyTo: TIdEmailAddressList read write;

Example

procedure SetReplyRoute;
var
Msg: TIdMessage;
ReplyAddress: TIdEmailAddressItem;
begin
Msg := Email;
if Msg = nil then Exit;

Msg.ReplyTo.Clear;
ReplyAddress := Msg.ReplyTo.Add;
ReplyAddress.Address := 'support@example.invalid';
end;

Usage

ReplyTo holds the address list projected into Reply-To for response routing, without changing the default SMTP sender or recipient envelope.

Additional Technical Info

ReplyTo returns the live message-owned TIdEMailAddressList used for the Reply-To header. It tells a recipient user agent where replies should be addressed; it does not redirect the original delivery.

Assignment calls ReplyTo.Assign(value) into the existing owned collection. Direct methods mutate it in place. The list/items are borrowed, nil assignment is not guarded, and permissive parsing is not strict address validation.

GenerateHeader MIME-encodes and joins every entry into Reply-To. ProcessHeaders destructively parses the raw field and decodes display names. Empty input clears the generated value, and ClearHeader clears the list.

Indy's default SMTP envelope construction ignores ReplyTo: recipients come from To/Cc/Bcc, and MAIL FROM comes from Sender or From. Reply routing is a header-level instruction only and can be ignored or overridden by mail software and policy.

NoEncode writes raw Headers, so typed ReplyTo edits are omitted unless the raw field is also synchronized. Validate externally supplied reply addresses to avoid redirecting users to attacker-controlled destinations, and make the change visible in business/security review when it crosses trust boundaries.

The example uses a reserved .invalid destination and was not executed or sent.

External references

Created 2026-07-15