CreateWithUserPassword(UserName: String; Password: String);
UserName is user name.
Password is user password.
The CreateWithUserPassword method determines the user credentials for connection to server.
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: