CSmtpClient::GetLocalName Method  
 
INT GetLocalName(
  LPTSTR lpszLocalName,  
  INT nMaxLength  
);
INT GetLocalName(
  CString& strLocalName  
);

The GetLocalName method returns the local domain name used to identify the client to the mail server.

Parameters

lpszLocalName
The buffer that will contain the local domain name as a string. This may also be a CString object which will contain the domain name when the method returns.
nMaxLength
The maximum number of characters that may be copied into the string buffer.

Return Value

If the method succeeds, the return value is the length of the domain name string. If the method fails, the return value is zero, meaning that no local domain name has been specified for this client session.

Remarks

If no local domain name has been explicitly set, then the client will use the default domain name for the local host as configured in the operating system. Note that this is not a general purpose method which can be used to determine the domain name that as been assigned to the local host. It will only return the local domain name set by a previous call to the SetLocalName method.

Requirements

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

See Also