Internet Direct (Indy)
Home
PreviousUpNext
TIdMessage.Recipients Property

Identifies the recipients of a message.

Pascal
property Recipients: TIdEmailAddressList;

Recipients is a TIdEMailAddressList property used to store a collection of TIdEmailAddressItem values that identify the recipients of the message. Recipients contains email addresses receiving the message as indicated in the RFC 2822 message header "To:". 

Use the EmailAddresses property in Recipients to get/set a delimited list of all email addresses in the collection. Use methods in Recipients like Add, Insert, or Delete to maintain individual email addresses in the collection. 

Use CCList to indicate email addresses receiving a Carbon Copy of the message. Use BCCList to indicate email addresses receiving a Blind Carbon Copy of the message.

(Delphi) Updating a list of recipient email addresses 

 

  // method One
  AMessage.Recipients.EmailAddresses :=
    '"John Doe" <jdoe@some.net>, ' +
    '"Jane Doe" <janed@another.net>';

  // method Two
  with AMessage.Recipients.Add do
  begin
    Name := 'John Doe';
    Address := 'jdoe@some.net';
  end;

  with AMessage.Recipients.Add do
  begin
    Name := 'Jane Doe';
    Address := 'janed@another.net';
  end;

  // method Three
  with AMessage.Recipients.Add do
    Text := '"John Doe" ';

  with AMessage.Recipients.Add do
    Text := '"Jane Doe" ';
Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.