im_SetProxy

Specifies the settings for a proxy service that can be used to connect to the email server.

Member of namespace

Imail

Syntax

bool im_SetProxy(string hostname, string proxyPort, string proxyType, string proxyUsername, string proxyPassword)

Parameters

Smart parameters are supported for all parameters.

hostname
The URL or IP address of the proxy service.

You can store the passed parameter value in the General section of the Datacap Application Manager.

proxyPort
The proxy service connection port.
proxyType
The type of proxy service. The following values are possible:
  • HTTP
  • SOCKS4
  • SOCKS5
  • NONE
Any unsupported type is treated as NONE.
proxyUsername
The username for the proxy server.

You can store the passed parameter value in the General section of the Application Manager.

proxyPassword
The password for the proxy server.

You can store the passed parameter value in the Advanced section of the Custom tab in the Application Manager. A smart parameter such as @APPVAR(values/adv/<mailProxyPassword>) retrieves the value, where <mailProxyPassword> is the name that you entered for the value in the Application Manager.

Returns

False if the proxyPort parameter value is not numeric. Otherwise, the action returns True.
Important: This action does not attempt to log on to the proxy service. The value True is returned regardless of the validity of the passed proxy service settings. If the settings are invalid, this condition is detected when you call im_login.

Level

Any level but typically batch level.

Details

Use this action to optionally specify a proxy service that connects to the email server. The im_login action uses the specified proxy service settings to connect to the proxy service. If you do not call this action before the call to im_login, no proxy service is used.
Example:

im_SetProxy("theHostName", "1234", "SOCKS4", "MyUser","@APPVAR(values/adv/mailProxyPassword)")
im_login("mymailserver.com","theuser","password")

In this example, the call to im_SetProxy specifies the settings for a proxy service, which the im_login action then uses to connect to that service. As illustrated, the smart parameter APPVAR can be used to pass in the proxyPassword parameter value for im_SetProxy.