Well if u r using the mailCore there is a value valled %Count which represents the amount of emails you have right now, my idea is to save the amount of email you haven't read and on each update (make it 20 - 30 min) check if the amount has been increased or not. If so play a sound and notify the user about an incoming mail.
So you should define a variable "started" onLoad, then u will have to add another one called mailAmount initially we will define it as zero
Code:
function onLoad()
{
started = false;
mailAmount = 0;
}
Add an event to the mail core onUpdate so we can compare the amount of email which had been added from the last time u had checked the mail count.
Code:
function mailCoreOnUpdate()
{
if ( mailAmount < mailCore.Count)
{
playSound();
showSomeSexyAnimation();
}
//Update the mail amount for further compares
mailAmount = mailCore.Count;
}
The code is not perfect, it will always play sound each time you start your computer or add this widget. And I haven't played yet with this core so im not sure what happen's when u actually read the email. If the amount just drops so that code should work fine, but if not tell me and ill try to figure it out.