WebMail.SmtpUseDefaultCredentials Property
Gets or sets a value that indicates whether the default credentials are sent with the requests.
Namespace: System.Web.Helpers
Assembly: System.Web.Helpers (in System.Web.Helpers.dll)
Syntax
'Declaration
Public Shared Property SmtpUseDefaultCredentials As Boolean
Get
Set
'Usage
Dim value As Boolean
value = WebMail.SmtpUseDefaultCredentials
WebMail.SmtpUseDefaultCredentials = value
public static bool SmtpUseDefaultCredentials { get; set; }
public:
static property bool SmtpUseDefaultCredentials {
bool get ();
void set (bool value);
}
static member SmtpUseDefaultCredentials : bool with get, set
static function get SmtpUseDefaultCredentials () : boolean
static function set SmtpUseDefaultCredentials (value : boolean)
Property Value
Type: System.Boolean
true if credentials are sent with the email message; otherwise, false.
Remarks
Some SMTP servers require that the client be authenticated before the server sends email on the client's behalf. Set this property to true when this WebMail object should, if requested by the server, authenticate using the default credentials of the currently logged on user. This is the usual behavior in most scenarios.
Credentials information can also be specified using the application and machine configuration files. For more information, see <mailSettings> Element (Network Settings).
If the SmtpUseDefaultCredentials property is set to false, the value set in the application and machine configuration files will be used for the credentials when connecting to the server. If the SmtpUseDefaultCredentials property is set to false and the credentials have not been set in the application and machine configuration files, email messages are sent to the SMTP server anonymously.
Security Note |
---|
If you provide credentials for basic authentication, they are sent to the server in clear text. This can present a security issue because your credentials can be seen by others. |