Internet Direct (Indy) Version 9.0.2 Beta
EncodeAddressItem
Converts an email address to a string using contenta and transfer encodings and character set.

function EncodeAddressItem(EmailAddr: TIdEmailAddressItem; const HeaderEncoding: Char; TransferHeader: TTransfer; MimeCharSet: string): string;
Parameters
EmailAddr: TIdEmailAddressItem
EMail address to be encoded.

const HeaderEncoding: Char
Header encoding for the encoded EMail address.

TransferHeader: TTransfer
Transfer encoding for the encoded EMail address.

MimeCharSet: string
MIME character set to use for the encoded EMail address.

Returns
String - The encoded EMail address in Name and Address format.

Description
EncodeAddressItem is a String function that converts the EMail address in EMailAddr to an encoded string representation using the encodings and character set specified in the parameters to the function. Encoding is performed using the EncodeHeader function when the email address contains characters not representable in the US-ASCII character set.

The return value for EncodeAddressItem is a string that represents the EMail address and optional name from EMailAddr. When EmailAddr contains the optional name, the return string contains data in the following format:

      John Doe 
    

The special characters '' and '"' in the email address will be quoted using the '' character.