Create an alarm based on incoming mail

Hi, Newbie here,I have a very important client and response time is critical.

So, if I get an email from a customer (could be anyone from that company) so let’s say @xyz.com, an alert posps up on the screen telling me an email from XYZ has arrived.

Can I accomplish this using scripts in Notes client?

Thank you

Subject: Create an alarm based on incoming mail

The best I can think of is to create an agent that runs when new mail arrives, and if it’s from that company you could add an entry to your calendar (and put it in the $Alarm folder) to pop up a messge to you a coouple of minutes later. I can tell you from experience though, that trying add something to your calendar that works as you expect can be tricky…there are so many hidden fields it relys on. I’ve never done a reminder though, they may not be so bad.

Subject: Create an alarm based on incoming mail

so do you want an alarm or an alert? I will assume the latter so create a New Mail agent in your mail file using the below code. Make sure the agent security is set to Allow Restricted Operations or it won’t run

Sub Initialize

' sends a popup if any mail from yahoo.com is received

Dim ns As New NotesSession

Dim doc As NotesDocument

Set doc = ns.DocumentContext

tome$ = Strleft(doc.SendTo(0), "@")

key$ = Lcase("yahoo.com")

frm$ = Lcase(doc.From(0))

pos% = Instr(frm$, "@")

If Instr(pos% +1, frm$, key$) > 0 Then

	txt$ =  "New mail from " & frm$

	alert$ = {BroadCast "(!) } + txt$ + {" "} + tome$ + {"}

	consoleReturn$ = ns.SendConsoleCommand( "", alert$ )

End If

End Sub