SetProxy
PowerScript function
Description
Sets the server proxy of this email message.
Applies to
SMTPClient object in Objects and Controls
Syntax
|
1 |
smtpclient.SetProxy(string host, long port{, integer proxytype}{, string username , string password}) |
|
Argument |
Description |
|---|---|
|
smtpclient |
A SMTP client object identifying the client in which you |
|
host |
A string that contains the proxy services. When it is set |
|
port |
A long that contains the services port. |
|
proxytype (optional) |
Specifies the values of the proxy type. Values are: 0 — Use SOCKS4 Proxy. 1 — Use SOCKS4a Proxy. The proxy resolves URL 2 — Use SOCKS5 Proxy. 3 — (Default) Use SOCKS5h Proxy. The proxy resolves URL |
|
username (optional) |
A string that contains the services proxy name. |
|
password (optional) |
A string that contains the services proxy password. |
Return value
Integer.
Returns 1 if it succeeds and -1 if an error occurs. If any
argument’s value is null, the method returns null.
Examples
The following example sets the IP address and the port of the
proxy.
|
1 |
lnv_SmtpClient.SetProxy("192.168.168.10",8004) |
The following example sets the IP address, port, proxy type, user
name and password of the proxy.
|
1 |
lnv_SmtpClient.SetProxy("192.168.168.10",8004,5,"proxy-myusername","proxy-mypassword") |
The following example cancels the proxy that is set before.
|
1 |
lnv_SmtpClient.SetProxy("",0) |
See also