receive windows popup message or alert for a specific incoming mail

Viewed 101

we have following problem. we need an extra windows popup message or baloon tip message in windows, if a mail from a specific sender arrives in outlook. are there any examples in powershell or any other programms recommend?

thanks in advance

3 Answers

You can use basic Outlook rules to create a desktop alert with any given condition, no need for any script or special program

If you want, the rule can also run a script and then you can do whatever you want there

From the following webpage, https://www.slipstick.com/outlook/rules/outlooks-rules-and-alerts-run-a-script/

Using VBA

Something like this:

Public Sub ShowMessage(Item As Outlook.MailItem)

'code

End Sub

The argument must by type MailItem or MeetingItem for the subroutine to be available in the Rules Wizard in Outlook 2007. In Outlook 2010 and 2013 (and up), PostItem also works.

Open Rules Wizard. In Outlook 2010 and 2013, it's on Outlook's Home ribbon, Rules > Manage Rules & Alerts. Look on the Tools menu in older versions. Open Rules Wizard Click New Rule. Select Apply Rule on messages I receive and click Next. Select your conditions and click Next. Select Run a script action (near the bottom). The finished run a script rule Click on a script. Select the script Select your script, click OK. Click Next then finish the rule.

There are several ways to get the job done:

  1. Create a rule in Outlook manually and assign a VBA macro which can be triggered by the rule. For example:
Public Sub TestRule(Item As Object)

If(Item.SenderEmailAddress = "eugene@test.com") Then
 MsgBox "Got email!"
End If

End Sub
  1. Use the VBA routine for handling incoming emails. The NewMailEx event fires when a new message arrives in the Inbox and before client rule processing occurs. You can use the Entry ID returned in the EntryIDCollection array to call the NameSpace.GetItemFromID method and process the item. This event fires once for every received item that is processed by Microsoft Outlook. The item can be one of several different item types, for example, MailItem, MeetingItem, or SharingItem. The EntryIDsCollection string contains the Entry ID that corresponds to that item.
Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
   Dim mai as Object
   Set mai = Application.Session.GetItemFromID(EntryIDCollection)

   If(mai.SenderEmailAddress = "eugene@test.com") Then
     MsgBox "Got email!"
   End If
End Sub
Related