Internet Direct (Indy)
Home
PreviousUpNext
TIdEMailAddressItem.User Property

Represents the mailbox User name in the email address.

Pascal
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" <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>'

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.

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.