CSmtpClient::VerifyAddress Method  
 
INT VerifyAddress(
  LPCTSTR lpszAddress,  
  LPTSTR lpszBuffer,  
  INT nMaxLength  
);
INT VerifyAddress(
  LPCTSTR lpszAddress,  
  CString& strBuffer  
);

The VerifyAddress method verifies the specified address is valid.

Parameters

lpszAddress
Points to a string which specifies the address that the server should verify.
lpszBuffer
Points to a buffer that the verified address will be copied into. This argument may also be a CString object which will contain the verified address 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 VerifyAddress method requests that the server verify the specified email address. Typically this is used to verify that a recipient address is valid, and return a fully qualified email address for that recipient. A server may not support this command, or may restrict its usage. An application should not depend on the ability to verify 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, ExpandAddress