Busy Property
Indicates whether SMTP
object is performing long-run operation (such as connecting to the server or
sending a message).
When SMTP object is busy, attempt to call any of its methods which exchange
data with SMTP server will immediately exit. To cancel currently executing long-run
operation, call Abort method.
Note: Busy property is useful on conditions that SMTP
object operates in Async mode. See EnableEvents
property description for details.
| Value Type: | Boolean | |
| Parameters: | None | |
| Remarks: | This property is read-only | |
Usage example:
Option Explicit
Dim WithEvents objSMTP As Object
Private Sub Command1_Click()
Set objSMTP = CreateObject("MailBee.SMTP")
objSMTP.LicenseKey = "put your license key here"
objSMTP.EnableEvents = True ' Enable asynchronous mode
objSMTP.ServerName = "mailserver.com"
If objSMTP.Connect Then ' Long-run operation
objSMTP.RelayMessage "C:\Data\email.eml", "from@addr.com", "to@addr.com" ' Long-run operation
objSMTP.Disconnect ' Long-run operation
End If
End Sub
Private Sub Form_Load()
Set objSMTP = Nothing
End Sub
Private Sub Form_Unload(Cancel As Integer)
If objSMTP Is Nothing Then Exit Sub
If objSMTP.Busy Then objSMTP.Abort ' Cancel SMTP session on exit
End Sub
See Also:
EnableEvents
Property
Abort Method
Copyright © 2002-2024, AfterLogic Corporation. All rights reserved.