CSmtpClient::SetLocalName Method  
 
BOOL SetLocalName(
  LPCTSTR lpszLocalName  
);

The SetLocalName method sets the local domain name used to identify the client to the mail server.

Parameters

lpszLocalName
A null-terminated string which specifies the local domain name to be used by the client when establishing a connection with the mail server. A value of NULL or an empty string clears the domain name.

Return Value

If the method succeeds, the return value is non-zero. If the method fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The SetLocalName method should only be used to specify a domain name if it is absolutely necessary. In most cases, it is preferable to allow the library to automatically determine the correct domain name to use. Providing an invalid domain name may cause the mail server to reject the connection.

This method may only be called prior to establishing a connection with the mail server using the Connect method. After the connection has been made, this method will fail. To change the local domain name used by the client, you must first terminate the current session.

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