Command IMAP_Login

4D Internet Commands

IMAP_Login

version 6.8.1


IMAP_Login (hostName; userName; password; imap_ID) Integer

ParameterTypeDescription
hostNameStringHost Name or IP address of the IMAP server
userNameStringUser name
passwordStringPassword
imap_IDLongintReference to this IMAP login

Function result Integer Error code

Description

The IMAP_Login command logs the user onto the IMAP electronic mail server with the given user name and password.

This particular login is given a connection reference (imap_ID) to which subsequent IMAP commands can refer.

The connection is closed using the IMAP_Logout command or when the IMAP server inactivity timer has timed out.

hostName is the host name or IP address of the IMAP electronic mail server. It is recommended that the host name be used but, if needed, an IP address may be used.

userName is the user's name on the IMAP electronic mail server. The userName should not contain the domain. For example, for the address "[email protected]", the userName would be just "jack".

password is the password for the userName on the IMAP electronic mail server.

imap_ID is a long integer variable into which a reference to the connection just established is returned. This parameter must be passed a 4D variable in order to accept the returned results. The variable will be used in all subsequent commands which perform actions related to this session.

If IMAP_Login fails, imap_ID is set to zero.

Example

Here is a typical connection sequence:

   $ErrorNum:=IMAP_Login (vHost;vUserName;vUserPassword;vImap_ID)
   If($ErrorNum =0)
      C_TEXT(vCapability)
      $ErrorNum:=IMAP_Capability (vImap_ID;vCapability))
      … ` IMAP commands using vImap_ID parameter
   End if
   $ErrorNum:=IMAP_Logout (vImap_ID)

See Also

IMAP_Logout, IMAP_VerifyID.