Launching Mail.app programatically?

Discussion in 'iOS Programming' started by bitesize, Aug 12, 2009.

  1. bitesize macrumors member

    Joined:
    Oct 15, 2008
    #1
    Is it possible to launch Mail.app programatically?
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Yes.









    OK, so you probably want more than that and are seem to be too lazy to use Google so I suggest you look at the mailto: URL schema. Note that this only allows you to open the app with a new mail: you can't open the app with an existing mail open, in a folder, anything like that.

    You should look at the UIApplication documentation, specifically the
    openURL method.
     
  3. bitesize thread starter macrumors member

    Joined:
    Oct 15, 2008
    #3
    Is the mailto: method the only option?

    I was hoping to be able to open it to the main Mail.app screen without composing a new email.
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    The only way to open any app (built-in or otherwise) is via the URL method using a URL schema that it has registered. Mail only registers mailto: so that's your only option.
     
  5. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #5
    What about the "in app email" API that got added to the 3.0 OS?

    There's plenty of documentation on this API at the Apple dev site if the OP is capable of actually reading...
     
  6. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    That lets you compose a new mail and send it from within the app. It doesn't have anything to do with launching the mail app itself...
     

Share This Page