Indy 9
TIdEMailAddressItem
Hierarchy, Properties, Methods, See Also, Unit: IdEMailAddress
Represents the name an email address in RFC 822 form.
TIdEMailAddressItem = class(TCollectionItem)
Unit
IdEMailAddress
Description
The TIdEMailAddressItem object structures a person's name and E-Mail address into a RFC 822-compliant form, and can parse a RFC 822-compliant EMail address into the person's name and E-Mail address. TIdEMailAddressItem also provides encoding and decoding of quoted characters as specified in the the lexical requirements for character quoting in RFC 822.

TIdEMailAddressItem.Address
TIdEMailAddressItem
Represents the person's Email address.
property Address: string;
Description
Address is a String property that represents an Email address in RFC 822-compliant form. Updating the Name or Address portions of the email address causes the Text property to be updated to reflect the previous changes to the new email address. For example:

    AEmail.Text := '"John Doe" <jdoe@some.net>'; // AEmail.Name
    contains '"John Doe"' // AEmail.Address contains 'jdoe@some.net'

    AEmail.Name := 'Jane Doe'; AEmail.Address := 'janed@another.net'; //
    AEmail.Text contains 'Jane Doe <janed@another.net>'

TIdEMailAddressItem.Name
TIdEMailAddressItem, See Also
Represents the person's name in an EMail address.
property Name: string;
Description
Name is a String property that represents the person's name in the Email address. Updating the Name or Address portions of the EMail address causes Text to be updated to reflect the changes in to the other property values. For example:

    AEmail.Text := '"John Doe" <jdoe@some.net>';
    // AEmail.Name contains '"John Doe"'
    // AEmail.Address contains 'jdoe@some.net'

    AEmail.Name := 'Jane Doe';
    AEmail.Address := 'janed@another.net';
    // AEmail.Text contains 'Jane Doe <janed@another.net>'

TIdEMailAddressItem.Text
TIdEMailAddressItem, See Also
Represents the the full contents of an email address.
property Text: String;
Description
Text is a String property that represents the person's name and email address in RFC 822-compliant form. Text can be used to set both the Name and Address for the TIdEMailAddressItem by providing an RFC 822-compliant string. For example:

    AEmail.Text := '"John Doe" <jdoe@some.net>';
    // AEmail.Name contains '"John Doe"'
    // AEmail.Address contains 'jdoe@some.net'

    AEmail.Name := 'Jane Doe';
    AEmail.Address := 'janed@another.net';
    // AEmail.Text contains 'Jane Doe <janed@another.net>'

When changing the property value, the new valueis examined for use of reserved characters, including '<', '>', '@', '(', ')', '"', SPACE, and TAB. When the new value for Text contains one of these reserved characters, it is examined for proper use of the preceeding in the name and address portions of the email address.


TIdEMailAddressItem.Assign
TIdEMailAddressItem, See Also
Copies the properties of an Email Address item.
procedure Assign(Source: TPersistent); override;
Parameters
ASource
Persistent class to be assigned to the current object instance.
Description
Assign is an overloaded procedure that allows the persistent TIdEmailAddressItem to assign the values in another instance to the current instance.

Assign copies the values of the Name and Address members when ASource is another TIdEMailAddessItem instance. Otherwise, Assign relies on the inherited Assign method.


Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.