INetNetworkCredential.CreateWithUserPassword

Syntax

CreateWithUserPassword(UserName: String; Password: String);

Parameters

UserName is user name.

Password is user password.

Description

The CreateWithUserPassword method determines the user credentials for connection to server.

Example

Sub UserProc;

Begin

SmtpClient := New NetSmtpClient.CreateWithHost("www.host.net");

Credent := New NetNetworkCredential.Create("myusername","mypwd","PROGNOZ");

Credent.CreateWithUserPassword("username_2","pwd_2");

SmtpClient.ThisHostCredentials("PLAIN") := Credent;

End Sub UserProc;

After executing this example the username_2 user credentials are used for the connection to server.

See also:

INetNetworkCredential