Dart Smtp, Pop, Imap Controls
Command Method
Specifies the command to send.
Undimensioned String or Byte Array. Where the reply from the server will be put. Any contents will be replaced. A message would not be returned for this parameter when the Progress event fires, as that information would be available elsewhere.
Description
Send any command string.
Syntax
Visual Basic
Public Sub Command( _
   ByVal Command As String, _
   ByRef Reply As Variant _
) 
Parameters
Command
Specifies the command to send.
Reply
Undimensioned String or Byte Array. Where the reply from the server will be put. Any contents will be replaced. A message would not be returned for this parameter when the Progress event fires, as that information would be available elsewhere.
Remarks

This method allows standard and non-standard commands to be sent. The reply from the server is copied to Reply; you determine success or failure. Reply must not go out of scope while the command completes (it must have file or global scope)

The control appends a CR/LF pair to the end of all commands so you should not send commands with a trailing CR/LF.

All commands must begin with a unique command identifier. The control generates and adds this to the beginning of a command you should not send commands with preceding command identifiers.

Error Codes

This method may generate the following error code (refer to MailErrorConstants for a complete list of error codes):

Example
Private Sub Command1_Click()
	On Error GoTo OnError ' use intrinsic error handling
	Dim Reply As String
	' Timeout 30 seconds
	Imap1.Timeout = 30000
	' login to the server
	Imap1.Login "imap.test.com", "MyUsername", "MyPassword"
	' send a standard NOOP command to the server
	Imap1.Command "NOOP", Reply
	MsgBox "Server Reply: " & Reply
	Exit Sub
OnError: ' Any error jumps here
	Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description
End Sub
See Also

Imap Object  | Imap Members


PowerTCP Mail for ActiveX Documentation Version 2.13
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic