4D v18SMTP_transporter.checkConnection( ) |
||||||||||||||||||||||||||||||||||
|
4D v18
SMTP_transporter.checkConnection( )
|
Property | Type | Description | |
success | Boolean | True if the check is successful, False otherwise | |
status | Number | Status code returned by the SMTP server (0 in case of an issue unrelated to the SMTP processing) | |
statusText | Text | Status message returned by the SMTP server, or last error returned in the 4D error stack | |
errors | Collection | 4D error stack (not returned if a SMTP server response is received) | |
[ ].errCode | Number | 4D error code | |
[ ].message | Text | Description of the 4D error | |
[ ].componentSignature | Text | Signature of the internal component which returned the error |
Note: For information about SMTP status codes, please refer to this page.
C_TEXT($pw)
C_OBJECT($options)
$options:=New object
$pw:=Request("Please enter your password:")
$options.host:="smtp.gmail.com"
$options.user:="test@gmail.com"
$options.password:=$pw
$transporter:=SMTP New transporter($options)
$status:=$transporter.checkConnection()
If($status.success=True)
ALERT("SMTP connection check successful!")
Else
ALERT("Error # "+String($status.status)+", "+$status.statusText)
End if
Product: 4D
Theme: Mail
4D Language Reference ( 4D v18)