語言

SmtpNetworkElement.UserName 屬性

定義

取得或設定使用者名稱以連接 SMTP 郵件伺服器。

public:
 property System::String ^ UserName { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("userName")]
public string UserName { get; set; }
[<System.Configuration.ConfigurationProperty("userName")>]
member this.UserName : string with get, set
Public Property UserName As String

屬性值

一個字串代表連接至 SMTP 郵件伺服器的使用者名稱。

屬性

備註

設定 DefaultCredentials 優先於設定 UserName 和 Password。 UserName Password且僅在 DefaultCredentials 被設定為 false時才會使用 。

適用於

另請參閱