CSmtpClient::ExpandAddress Method  
 
INT ExpandAddress(
  LPCTSTR lpszMailingList,  
  LPTSTR lpszAddresses,  
  INT nMaxLength  
);
INT ExpandAddress(
  LPCTSTR lpszMailingList,  
  CString& strAddresses  
);

The ExpandAddress method expands the specified mailing list, returning the membership of that list.

Parameters

lpszMailingList
Points to a string which specifies the mailing list that the server should expand into full addresses.
lpszAddresses
Points to a buffer that the expanded addresses will be copied into. This argument may also be a CString object which will contain the expanded addresses when the method returns.
nMaxLength
Maximum number of characters that may be copied into the buffer, including the terminating null character.

Return Value

If the method succeeds, the return value is the server result code. If the method fails, the return value is SMTP_ERROR. To get extended error information, call GetLastError.

Remarks

The ExpandAddress method requests that the server expand the specified email address. Typically this is used to expand aliases which refer to a mailing list, returning all of the members of that list. A server may not support this command, or may restrict its usage. An application should not depend on the ability to expand addresses.

This method cannot be called while a mail message is being composed.

Requirements

Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header File: cstools10.h
Import Library: csmtpv10.lib
Unicode: Implemented as Unicode and ANSI versions.

See Also

AddRecipient, VerifyAddress