ExecuteCommand Method


ExecuteCommand method sends specified string of data to the SMTP server. Commands must end with CRLF pair (vbCrLf constant in Visual Basic and ASP).


blnResult = ObjectName.ExecuteCommand(Command)
 
Parameters:  
Value As String A string expression containing command name for execution.  
Return value As Boolean True if successful, otherwise False.  

Usage example:

' This sample sends the command 'ehlo' to the server and outputs its result  

Dim Mailer
' Using visual basic to create object
Set Mailer = CreateObject("MailBee.SMTP")
' Using ASP to create object
' Set Mailer = Server.CreateObject("MailBee.SMTP")
' In ASP use Response.Write instead of MsgBox
Mailer.LicenseKey = "put your license key here"
Mailer.ServerName = "mail.server.com"
If Mailer.Connect Then
   Mailer.ExecuteCommand "ehlo yourdomain.com" & vbCrLf
   MsgBox Mailer.ServerResponse
   Mailer.Disconnect
End If

See Also:

SMTP Object


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