Export (0) Print
Expand All

SmtpNetworkElement.ClientDomain Property

Gets or sets the client domain name used in the initial SMTP protocol request to connect to an SMTP mail server.

Namespace:  System.Net.Configuration
Assembly:  System (in System.dll)

[ConfigurationPropertyAttribute("clientDomain")]
public string ClientDomain { get; set; }

Property Value

Type: System.String
A string that represents the client domain name used in the initial SMTP protocol request to connect to an SMTP mail server.

The ClientDomain property allows an application to change the client domain name used in the initial SMTP protocol request to an SMTP server. If the ClientDomain property is not set, the default is to use the localhost name of the local computer sending the request.

RFC 2821 that defines the details of the Simple Mail Transport Protocol (SMTP). This RFC stipulates that an SMTP client should use a fully-qualified domain name as part of its HELO or Extended HELO (EHLO) message to a server.

The ClientDomain property allows an application to change the client domain name (the RFC uses the term Domain in the protocol description) to use the fully-qualified domain name of the local machine, rather than the localhost name that is used by default. This provides greater compliance with the SMTP protocol standards. However, the fully-qualified domain name may expose private information about the local computer.

Any name set in the ClientDomain property should conform to DNS rules for 7-bit ASCII names.

The default value for this network element in the SMTP configuration file can also be changed by manually editing the machine or application configuration files directly.

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft