iOS How Do I Access Email Messages?

ArtOfWarfare

macrumors G3
Original poster
Nov 26, 2007
8,575
4,005
I have ideas for an iOS email client that mostly focuses around having your content automagically organized for you. I know how to send emails from iOS via the Message UI Framework, but I don't know how to access email messages.

How do I:
1 - Access email accounts the user has configured on the device*?
2 - Download email messages that the user has sent?
3 - Download email messages that the user has received?

* Not a deal breaker if I can't, but it'd be really nice if my client had no set up necessary for any accounts the user already set up for the built in mail application.
 

Guiyon

macrumors 6502a
Mar 19, 2008
767
1
North Shore, MA
Due to the sandbox, your options are pretty limited here. You'll need to implement your own mail stack (or find one with an appropriate license). The first that comes to mind is MailCore

To summarize:
1: You don't. You can send an email, that's about it
2 & 3: Build an IMAP/POP/SMTP client
 

ArtOfWarfare

macrumors G3
Original poster
Nov 26, 2007
8,575
4,005
Due to the sandbox, your options are pretty limited here. You'll need to implement your own mail stack (or find one with an appropriate license). The first that comes to mind is MailCore

To summarize:
1: You don't. You can send an email, that's about it
2 & 3: Build an IMAP/POP/SMTP client
MailCore looks like an immensely useful framework, thanks for sharing!

Can I at least fetch a list of email accounts the user has configured on iOS, so I can prompt them for the necessary information for accounts I know they have?
 

ArtOfWarfare

macrumors G3
Original poster
Nov 26, 2007
8,575
4,005
I don't believe you can.
Hmm... Alright. I'm planning on making the app for both OS X and iOS so maybe I'll make the OS X app grab that kind of information and sync it with iOS... Or maybe I'll just make a companion utility that I host on Dropbox and have people download that and all it does is take the info and send it to the iOS version.

I guess it's not the biggest concern right now.

Maybe I should learn how the other mail apps work...
 

Guiyon

macrumors 6502a
Mar 19, 2008
767
1
North Shore, MA
Hmm... Alright. I'm planning on making the app for both OS X and iOS so maybe I'll make the OS X app grab that kind of information and sync it with iOS... Or maybe I'll just make a companion utility that I host on Dropbox and have people download that and all it does is take the info and send it to the iOS version.

I guess it's not the biggest concern right now.

Maybe I should learn how the other mail apps work...
If you are going to have it on the App Store you may run into issues there as well; I'm not sure how limited access to the Keychain is when running in the sandbox.
 

truehybridx

macrumors member
Dec 6, 2010
86
0
Doesn't that run into privacy concerns?

And with all the privacy drama going on would be a bad idea :/
 

ArtOfWarfare

macrumors G3
Original poster
Nov 26, 2007
8,575
4,005
If you are going to have it on the App Store you may run into issues there as well; I'm not sure how limited access to the Keychain is when running in the sandbox.
On OS X Apple allows apps that poke holes in the sandbox if you clearly disclose that you are doing so and explain why. The free utility would be distributed through a public folder in Dropbox (easiest way I've found for distributing free OS X apps) and doesn't need to limit itself to the sandbox at all.
 

ArtOfWarfare

macrumors G3
Original poster
Nov 26, 2007
8,575
4,005
Due to the sandbox, your options are pretty limited here. You'll need to implement your own mail stack (or find one with an appropriate license). The first that comes to mind is MailCore

To summarize:
1: You don't. You can send an email, that's about it
2 & 3: Build an IMAP/POP/SMTP client
I would like to point out that there actually appears to be a newer version of MailCore, MailCore 2, which supports IMAP, SMTP, and POP (whereas the original version only supports IMAP and SMTP as far as I can tell.)

The process for including it also appears to have been simplified.

Here's a link to MailCore2's repo:
https://github.com/MailCore/mailcore2
(Notice that both appear to be hosted on the same account.)

Here's a YouTube video showing how to set it up:
 
Last edited by a moderator: