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