Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Notification when new email received



Steve Cronin wrote:

I've checked around and I don't see any formal means to be notified
when a new piece of email is received.
Yes, I do realize the general problem of the many different mail
clients but my interest is (for now) in Mail.app.

Given that, what would be the general counsel for best way to keep up-
to-date with new mail?

I have the AppleScript to get unread counts from any desired
mailbox, I'm thinking I should just run this AppleScript using NSTimer.


Polling the unread count would be unreliable; e.g. users may get and read new mails between polls.

AKAIF, the only formal notification mechanism in Mail is its rules system. e.g. You could set up a Mail rule that runs an AppleScript when new messages arrive (rule creation can be scripted if you want to set this up automatically). That script could then send an Apple event to your application informing it that new mail has arrived, along with any information about the received messages that your application might need.

Depending on your requirements it might be possible for some other email clients to invoke the same API, which will simplify adding support for those.

You'd need to say more about what your app does and how it needs to interact with email clients to give more specific suggestions.

You might also file a feature request on Mail, asking that it send a distributed notification when new mail arrives.

HTH

has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.