API for Mail.app and Stickies

Discussion in 'Mac Programming' started by Amuraivel, Nov 14, 2008.

  1. Amuraivel macrumors member

    Jan 31, 2006
    Two questions:

    1. For Safari there is the WebKit framework that makes building a webbrowser relative straight forward, is there an API for Mail.app data?

    2. Is there an API for the stickies database.

    I have tried finding something for both, but no dice.

  2. kainjow Moderator emeritus


    Jun 15, 2000
    1. See NSMailDelivery for sending emails via Mail.app. Go here for some sample code.
    2. There is none. The file ~/Library/StickiesDatabase can be read with some hacking around via NSUnarchiver (and class-dump).
  3. hhas macrumors regular

    Oct 15, 2007
    Nothing official for Stickies. If you want to interact with Mail.app, it has an Apple event ("AppleScript") interface (officially supported public API; somewhat buggy and inadequately documented) and an NSBundle-based plugin API (private, undocumented API; a number of folks have written third-party plugins for it, but caveat emptor).

    NSMailDelivery is deprecated as of Leopard. However, there are a number of third-party Cocoa frameworks for sending email, including:


    If the OP wants more specific advice or recommendations, they'll need to provide a bit more info about what it is they want to do.
  4. Amuraivel thread starter macrumors member

    Jan 31, 2006

    Thanks for the hints on sending mail.

    But I would also like to read the MBOX files directly not simply send mail. The goal is to develop an app that uses all the apple native files.

    Does anyone know of how these are read, and can be written to in OBJ-C?
  5. kainjow Moderator emeritus


    Jun 15, 2000
    If you're wanting to read Mail's data, start off with the ~/Library/Mail/Envelope Index file. It's a SQLite database. I'm pretty sure the raw email files inside the .mbox folders are named using each message's ID which is stored in the DB (last time I checked).

Share This Page