Topic Path: Symbol Reference > Classes > TIdEMailAddressItem Class > TIdEMailAddressItem Properties > User Property
TIdEMailAddressItem.User Property

Represents the mailbox User name in the email address.

property User: string;

User is a String property that represents the user name for the mailbox for the email address. The value in the User property is derived from the Address property, and represents the portion of the email Address that occurs before the '@' that indicates the host domain for the mailbox. User can return an empty string ('') when Address is blank, or when address does not contain an '@' character representing the Domain for the Address


   // var AEmail: TIdEmailAddressItem;

   AEmail.Text := '"John Doe" <>';
   // AEmail.Name contains 'John Doe'
   // AEmail.Address contains ''
   // AEmail.User contains 'jdoe'
   // AEmail.Domain contains ''

   AEmail.Name := 'Jane Doe';
   AEmail.Address := '';
   // AEmail.Text contains '"Jane Doe" <>'

The write accessor looks wrong in 10.1.5; it doesn't update the member var with the new value. 

Writing to the User property causes the value in the Address property to be updated to reflect the new value. Any exisiting Domain portion of the email Address is retained.

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