OnSendProgress Event


Fired by SMTP object after sending new chunk of message data.

This event can be fired multiple times (because each chunk has only 8 Kbytes length).

This event can be fired by both Send and RelayMessage methods.


Parameters:  
TotalBytesSent As Long Total count of message bytes already sent  
ByRef Proceed As Boolean Default value is True, which tells MailBee to continue sending message data. 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.ImportBodyText "C:\docs\letter.htm", True
    objSMTP.Message.BodyEncoding = 2
    objSMTP.Send
    objSMTP.Disconnect
  End If
End Sub

Private Sub objSMTP_OnSendProgress(ByVal TotalBytesSent As Long, Proceed As Boolean)
    MsgBox TotalBytesSent & " bytes sent"
End Sub

See Also:

EnableEvents Property
OnMessageReady Event
OnSendStart Event
OnSendComplete Event


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