Back to product page

Notification Property


Fast notifications interface.

Syntax

  • Basic
object.Notification [= value]
The Notification(object,value) syntax has these parts:
objectAn expression evaluating to an object of type wodSmtp
valueA value.

Remarks

This property is available only in DLL (COM Object) version of wodSmtp Component.

Notification property holds reference to IwodSmtpClientNotify interface that can be implemented by your application. When this property is set, and contains such a reference, wodSmtpCom 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 Smtp_Disconnected(ByVal ErrorCode As Long, ByVal ErrorText As String)
 
End Sub

you will have this:
Private Sub IwodSmtpClientNotify_Disconnected(ByVal Owner As WODSmtpCOMLib.IwodSmtpCom, ByVal ErrorCode As Long, ByVal ErrorText As String)
 
End Sub

pretty much the same - except notification method has one more argument - Owner, which holds reference to wodSmtpCom instance that called this method.

In VB, to implement IwodSmtpClientNotify interface, you need code like this: - at the top of the code, in general section, put this:
Dim Smtp As wodSmtpCom
Implements IwodSmtpClientNotify

- in Form_Load (or where you initialize new instance of wodSmtpCom) do this:
Set Smtp = New wodSmtpCom
Set Smtp.Notification = Me
Smtp.Port = 25
Smtp.Hostname
....
'...


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!

Platforms

Windows