SendCommand Method


Sends user-defined text to POP3 server.

You may use this method to send specific POP3 commands to the server. You must have some knowledge of POP3 protocol for using this method. Keep in mind the following considerations:


strResult = ObjectName.SendCommand(Command)  
Parameters:  
Command As String Text to be sent. This text must be properly formatted POP3 command  
ExpectMultilineResponse As Boolean (optional) If True, it is expected POP3 server will reply with a multi-line positive response to the given command. Default is False  
Return value As String Response from POP3 server to the custom command  

Usage example:

Dim Mailer
'Using visual basic to create object
Set Mailer = CreateObject("MailBee.POP3")
'Using ASP to create object
'Set Mailer = Server.CreateObject("MailBee.POP3")
'In ASP use Response.Write instead of MsgBox
Mailer.LicenseKey = "put your license key here"
Mailer.Connect "mailserver.com", 110, "MyName", "MyPassword"
If Mailer.Connected Then
  If Mailer.MessageCount > 0 Then
    Mailer.DeleteMessage 1 ' Mark the message for deletion
    Mailer.SendCommand "rset" & vbCrLf  ' Unmark messages marked for deletion
  End If
  Mailer.Disconnect
End If

See Also:

IsError Property


Copyright © 2002-2022, AfterLogic Corporation. All rights reserved.