SmtpNetworkElement.UserName Property

 

Gets or sets the user name to connect to an SMTP mail server.

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

[ConfigurationPropertyAttribute("userName")]
public string UserName { get; set; }

Property Value

Type: System.String

A string that represents the user name to connect to an SMTP mail server.

Setting DefaultCredentials takes precedence over setting UserName and Password. UserName and Password are used only if DefaultCredentials is set to false.

.NET Framework
Available since 2.0
Return to top
Show: