4D Internet Commands v16

IMAP_Login

Home

 
4D Internet Commands v16
IMAP_Login

IMAP_Login 


 

IMAP_Login ( hostName ; userName ; password ; imap_ID {; sessionParam} ) -> Function result 
Parameter Type   Description
hostName  String in Host Name or IP address of the IMAP server
userName  String in User name
password  String in Password
imap_ID  Longint in Reference to this IMAP login
sessionParam  Longint in 1 = Use SSL, 0 or omitted = Do not use SSL
Function result  Integer in Error code

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 “jack@4d.com”, 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.

The optional sessionParam parameter enables the SSL protocol for a connection:

  • If you pass 1, the connection to the IMAP server will be made in SSL (synchronous mode),
  • If you pass 0 or omit this parameter, the connection will be made in standard, non-secure mode.

Example  

Here is a typical connection sequence:

 $ErrorNum:=IMAP_Login(vHost;vUserName;vUserPassword;vImap_ID;1)
 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

 
PROPERTIES 

Product: 4D Internet Commands
Theme: IC IMAP Review Mail
Number: 88885

 
HISTORY 

Created: 4D Internet Commands 6.8.1
Modified: 4D Internet Commands v12.1

 
ARTICLE USAGE

4D Internet Commands ( 4D Internet Commands v16)