-
-
Basic information
As you might have read so far, wodSmtpServerCom can use
fast notification interface instead of firing events. This
means that each time wodSmtpServerCom 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.
wodSmtpServer ActiveX DOES NOT support notifications -
only wodSmtpServerCom component does!
You must declare ALL notification methods if you want to
implement INotifications,
no matter if you need them or not. For example, many users
don't need RelayCertificate
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
INotifications 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 INotifications
1. Add Reference to wodSmtpServerCom COM Object to your
application
2. Instead of declaring wodSmtpServer like this:
Dim WithEvents Smtp1 as
wodSmtpServerCom
you should do this:
Dim Smtp1 as wodSmtpServerCom
Implements INotifications
3. In Form_Load, create new instance for Smtp1, and pass
reference of our INotifications to it
Set Smtp1 = new wodSmtpServerCom
Set Smtp1.Notification = Me
4. Implement ALL methods, or at least declare their empty
bodies. You can do it automatically if you locate
'INotifications' 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
INotifications_Authenticate(ByVal Owner As
WODSMTPSERVERCOMLib.IwodSmtpServerCom, ByVal User As
WODSMTPSERVERCOMLib.ISmtpUser, ByVal Username As String,
ByVal Password As String, ByVal AuthMethod As
WODSMTPSERVERCOMLib.SmtpAuthentications, Action As
WODSMTPSERVERCOMLib.SmtpActions)
End Sub
Private Sub INotifications_Command(ByVal Owner As
WODSMTPSERVERCOMLib.IwodSmtpServerCom, ByVal User As
WODSMTPSERVERCOMLib.ISmtpUser, Command As String)
End Sub
Private Sub INotifications_Connected(ByVal Owner As
WODSMTPSERVERCOMLib.IwodSmtpServerCom, ByVal User As
WODSMTPSERVERCOMLib.ISmtpUser, Action As
WODSMTPSERVERCOMLib.SmtpActions)
End Sub
Private Sub INotifications_Connecting(ByVal Owner As
WODSMTPSERVERCOMLib.IwodSmtpServerCom, ByVal User As
WODSMTPSERVERCOMLib.ISmtpUser, Action As
WODSMTPSERVERCOMLib.SmtpActions)
End Sub
Private Sub INotifications_Disconnected(ByVal Owner As
WODSMTPSERVERCOMLib.IwodSmtpServerCom, ByVal User As
WODSMTPSERVERCOMLib.ISmtpUser)
End Sub
Private Sub INotifications_DNSResponse(ByVal Owner As
WODSMTPSERVERCOMLib.IwodSmtpServerCom, ByVal Address As
String, ByVal Response As String, ByVal Success As Boolean,
ByVal ID As Variant)
End Sub
Private Sub INotifications_ExpandAddress(ByVal Owner As
WODSMTPSERVERCOMLib.IwodSmtpServerCom, ByVal User As
WODSMTPSERVERCOMLib.ISmtpUser, ByVal Address As String,
Response As Variant)
End Sub
Private Sub INotifications_HeadersReceived(ByVal Owner As
WODSMTPSERVERCOMLib.IwodSmtpServerCom, ByVal User As
WODSMTPSERVERCOMLib.ISmtpUser, ByVal Headers As
WODSMTPSERVERCOMLib.ISmtpHeaders)
End Sub
Private Sub INotifications_HeloReceived(ByVal Owner As
WODSMTPSERVERCOMLib.IwodSmtpServerCom, ByVal User As
WODSMTPSERVERCOMLib.ISmtpUser, ByVal HELOdomain As String,
Action As WODSMTPSERVERCOMLib.SmtpActions)
End Sub
Private Sub INotifications_MailFrom(ByVal Owner As
WODSMTPSERVERCOMLib.IwodSmtpServerCom, ByVal User As
WODSMTPSERVERCOMLib.ISmtpUser, Address As String, Action As
WODSMTPSERVERCOMLib.SmtpActions)
End Sub
Private Sub INotifications_MailReceived(ByVal Owner As
WODSMTPSERVERCOMLib.IwodSmtpServerCom, ByVal User As
WODSMTPSERVERCOMLib.ISmtpUser, Action As
WODSMTPSERVERCOMLib.SmtpActions)
End Sub
Private Sub INotifications_MailReset(ByVal Owner As
WODSMTPSERVERCOMLib.IwodSmtpServerCom, ByVal User As
WODSMTPSERVERCOMLib.ISmtpUser)
End Sub
Private Sub INotifications_MailStart(ByVal Owner As
WODSMTPSERVERCOMLib.IwodSmtpServerCom, ByVal User As
WODSMTPSERVERCOMLib.ISmtpUser)
User.Message.FileName = App.Path +
"\Messages\message." & Counter
End Sub
Private Sub INotifications_MailTo(ByVal Owner As
WODSMTPSERVERCOMLib.IwodSmtpServerCom, ByVal User As
WODSMTPSERVERCOMLib.ISmtpUser, Address As String, Action As
WODSMTPSERVERCOMLib.SmtpActions)
End Sub
Private Sub INotifications_RelayCertificate(ByVal Owner As
WODSMTPSERVERCOMLib.IwodSmtpServerCom, ByVal Relay As
WODSMTPSERVERCOMLib.ISmtpRelay, ByVal Cert As
WODSMTPSERVERCOMLib.ICertificate, ByVal ErrorCode As Long,
ByVal ErrorText As String, Accept As Boolean)
End Sub
Private Sub INotifications_RelayDone(ByVal Owner As
WODSMTPSERVERCOMLib.IwodSmtpServerCom, ByVal Relay As
WODSMTPSERVERCOMLib.ISmtpRelay)
End Sub
Private Sub INotifications_RelayError(ByVal Owner As
WODSMTPSERVERCOMLib.IwodSmtpServerCom, ByVal Relay As
WODSMTPSERVERCOMLib.ISmtpRelay, ByVal ErrorCode As Long,
ByVal ErrorText As String)
End Sub
Private Sub INotifications_RelayStateChange(ByVal Owner As
WODSMTPSERVERCOMLib.IwodSmtpServerCom, ByVal Relay As
WODSMTPSERVERCOMLib.ISmtpRelay, ByVal NewState As
WODSMTPSERVERCOMLib.SmtpRelayStates, ByVal OldState As
WODSMTPSERVERCOMLib.SmtpRelayStates)
End Sub
Private Sub INotifications_StateChange(ByVal Owner As
WODSMTPSERVERCOMLib.IwodSmtpServerCom, ByVal User As
WODSMTPSERVERCOMLib.ISmtpUser, ByVal NewState As
WODSMTPSERVERCOMLib.SmtpUserStates, ByVal OldState As
WODSMTPSERVERCOMLib.SmtpUserStates)
End Sub
Private Sub INotifications_VerifyAddress(ByVal Owner As
WODSMTPSERVERCOMLib.IwodSmtpServerCom, ByVal User As
WODSMTPSERVERCOMLib.ISmtpUser, ByVal Address As String,
Response As Variant)
End Sub
|