-
-
Basic information
As you might have read so far, wodSmtpCom can use
fast notification interface instead of firing events. This
means that each time wodSmtpCom needs to fire an
event, it will call your implementation of the event
instead. Notifications can be 30 times faster than events -
meaning it is advised to be used if speed is needed in your
applications.
wodSmtp ActiveX DOES NOT support notifications -
only wodSmtpCom component does!
You must declare ALL notification methods if you want to
implement
IwodSmtpClientNotify,
no matter if you need them or not. For example, many users
don't need
Connecting
event, but at least empty body for this event MUST exist
when notifications are used.
You can read below steps required to implement your own
IwodSmtpClientNotify interface. As an example, we will put it on
the main form. You can also put it into separate VB class,
in which case instead of 'Me' keyword, you will use name of the
class.
Steps needed to implement IwodSmtpClientNotify
1. Add Reference to wodSmtpCom COM Object to your
application
2. Instead of declaring wodSmtp like this:
Dim WithEvents Smtp1 as
wodSmtpCom
you should do this:
Dim Smtp1 as wodSmtpCom
Implements IwodSmtpClientNotify
3. In Form_Load, create new instance for Smtp1, and pass
reference of our IwodSmtpClientNotify to it
Set Smtp1 = new wodSmtpCom
Set Smtp1.Notification = Me
4. Implement ALL methods, or at least declare their empty
bodies. You can do it automatically if you locate
'IwodSmtpClientNotify' object in the list of all objects
existing on your form (combo box in upper left corner of
your code view), or just can do it by hand.
5. All done. Now put breakpoints to your methods. You will
see that instead of fired event, your methods will be
called instead.
Method declarations
Private Sub
IwodSmtpClientNotify_Connected(ByVal Owner As
WODSMTPCOMLib.IwodSmtpCom, ByVal Capabilities As String)
End Sub
Private Sub IwodSmtpClientNotify_Connecting(ByVal Owner As
WODSMTPCOMLib.IwodSmtpCom, ByVal Hostname As String, ByVal Port As
Long)
End Sub
Private Sub IwodSmtpClientNotify_Disconnected(ByVal Owner As
WODSMTPCOMLib.IwodSmtpCom, ByVal ErrorCode As Long, ByVal ErrorText
As String)
End Sub
Private Sub IwodSmtpClientNotify_DNSResponse(ByVal Owner As
WODSMTPCOMLib.IwodSmtpCom, ByVal Address As String, ByVal Response
As String, ByVal Success As Boolean, ByVal ID As Variant)
End Sub
Private Sub IwodSmtpClientNotify_Done(ByVal Owner As
WODSMTPCOMLib.IwodSmtpCom, ByVal ErrorCode As Long, ByVal ErrorText
As String)
End Sub
Private Sub IwodSmtpClientNotify_EhloResponse(ByVal Owner As
WODSMTPCOMLib.IwodSmtpCom, ByVal EhloText As String)
End Sub
Private Sub IwodSmtpClientNotify_HostCertificate(ByVal Owner As
WODSMTPCOMLib.IwodSmtpCom, ByVal Cert As WODSMTPCOMLib.ICertificate,
ByVal ErrorCode As Long, ByVal ErrorText As String, Accept As
Boolean)
End Sub
Private Sub IwodSmtpClientNotify_Progress(ByVal Owner As
WODSMTPCOMLib.IwodSmtpCom, ByVal Position As Long, ByVal Total As
Long)
End Sub
Private Sub IwodSmtpClientNotify_StateChange(ByVal Owner As
WODSMTPCOMLib.IwodSmtpCom, ByVal OldState As
WODSMTPCOMLib.SmtpStates)
End Sub
|