OnSendData Event
Fired by SMTP object after sending a new
chunk of any data to the server.
This event is fired any time the client sending anything to the server, not only when the client sends the actual message data (like OnSendProgress event does).
Parameters: | ||
BytesSent As Long | The size of the data chunk sent at this time. | |
ByRef Proceed As Boolean | Default value is True, which tells MailBee to continue SMTP session. You can set it to False to immediately abort SMTP session and disconnect from SMTP server | |
Remarks: | Events are turned off by default. To enable them, set EnableEvents to True |
Usage example:
Option Explicit Dim WithEvents objSMTP As MailBee.SMTP Private Sub Form_Load() Set objSMTP = New MailBee.SMTP objSMTP.LicenseKey = "put your license key here" objSMTP.EnableEvents = True objSMTP.ServerName = "mailserver.com" If objSMTP.Connect Then objSMTP.Message.ToAddr = "bill@yoursite.com" objSMTP.Message.FromAddr = "joe@mysite.com" objSMTP.Message.Subject = "Hello" objSMTP.Message.BodyText = "Body text" objSMTP.Send objSMTP.Disconnect End If End Sub Private Sub SMTP_OnReceiveData(ByVal BytesReceived As Long, Proceed As Boolean) Debug.Print "BytesReceived=" & BytesReceived Debug.Print "SMTP.GetLastDataFromServer=[" & SMTP.GetLastDataFromServer & "]" End Sub Private Sub SMTP_OnSendData(ByVal BytesSent As Long, Proceed As Boolean) Debug.Print "BytesSent=" & BytesSent Debug.Print "SMTP.GetLastDataFromClient=[" & SMTP.GetLastDataFromClient & "]" End Sub
See Also:
EnableEvents Property
OnSendProgress Event
Copyright © 2002-2024, AfterLogic Corporation. All rights reserved.