Topic Path: Symbol Reference > Classes > TIdEMailAddressItem Class > TIdEMailAddressItem Properties > Text Property
ContentsIndexHome
PreviousUpNext
TIdEMailAddressItem.Text Property

Represents the the full contents of an email address.

property Text: string;

Text is a String property that represents the persons name and email address in RFC 2822-compliant form. Text can be used to set both the Name and Address for the TIdEMailAddressItem by providing an RFC 2822-compliant string. 

For example: 

 

   // var AEmail: TIdEmailAddressItem;

   AEmail.Text := '"John Doe" <jdoe@some.net>';
   // AEmail.Name contains 'John Doe'
   // AEmail.Address contains 'jdoe@some.net'
   // AEmail.User contains 'jdoe'
   // AEmail.Domain contains '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 email address is 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 characters in the name and address portions of the email address. 

Use Address to access the email address represented by the User and Domain portions of the value; ie. without the Name portion of the email address. 

Use User and Domain to access the mailbox and registered organization for the email address.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.