property Message.Notifier as EMail

Changes or gets the message's object notifier.

TypeDescription
EMail An EMail object that receives all notifications.

By default, the Notifier property is set to nothing. The Notifier property specifies the way how the message is going to be delivered: non-blocking or blocking mode. In non-blocking mode the control fires events through EMail object, and it doesn't block the application while delivering the message. In blocking mode, the control doesn't fire any event, and the application is blocked while the control delivers the message. If the Notifier property points to an EMail object, then all message's notifications are handled by EMail object' events. The following sample shows how to deliver an email message using non-blocking mode:

Dim WithEvents e As EMail

Private Sub e_EndSend(ByVal Msg As EXEMAILLibCtl.IMessage)
    If (Msg.LastError = 0) Then
        MsgBox "The message was delivered OK."
    End If
    Debug.Print e.Error(Msg.LastError)
End Sub

Private Sub Form_Load()
    Set e = Runtime1.NewEMail
    Dim m As Message
    Set m = Runtime1.NewMessage
    Set m.Notifier = e
    m.Send "me", "mike2@Unknown2.com", "Test", "Hello world!"
End Sub

The following sample shows how to deliver an email message using the blocking mode:

Private Sub Form_Load()
    Dim m As Message
    Set m = Runtime1.NewMessage
    If (0 = m.Send("me", "mike2@Unknown2.com", "Test", "Hello world!")) Then
        MsgBox "The message was delivered OK."
    End If
End Sub