NOTE: This property is available only in COM
version of wodSmtpServer.
Notification property holds reference to IwodSmtpNotify
interface that can be implemented by your application. When
this property is set, and contains such a reference,
wodSmtpServer will call your method implementations instead
of firing events. More information on how this works can be
found here.
For example, instead of having this in your code (VB
example):
Private Sub wodSmtpServer1_Connected(ByVal User As
WODSMTPSERVERCOMLib.ISmtpUser, Action As WODSMTPSERVERCOMLib.SmtpActions)
End Sub
you will have this:
Private Sub INotifications_Connected(ByVal Owner As
WODSMTPSERVERCOMLib.IwodSmtpServerCom, ByVal User As
WODSMTPSERVERCOMLib.ISmtpUser, Action As WODSMTPSERVERCOMLib.SmtpActions)
End Sub
pretty much the same - except notification method has
one more argument - Owner, which holds reference to
wodSmtpServer instance that called this method.
In VB, to implement INotifications interface, you need
code like this:
- at the top of the code, in <general> section,
put this:
Dim Smtp1 As wodSmtpServerCom
Implements INotifications
- in Form_Load (or where you initialize new instance of
wodSmtpServer) do this:
Set Smtp1 = New wodSmtpServerCom
Set Smtp1.Notification =
Me
Smtp1.Port = 25
Smtp1.Start
'...
You can notice that when we declared Smtp, we did not
use WithEvents keyword - it is not
needed anymore, because events will not be fired anymore.
Notification methods we implement will be called
instead!