Reading mails

Hi, newbie question, sorry. But is there a way to read emails into an array? I am especially interest in the field data like date, sender, receiver, ccs, header, attachment flag, follow up, folder stored in, …nothing sinister. Just trying to write a more graphical mail app ala 3D. Thanks if anyone knows how to get to that data (assuming user grants access).

There is no way to access the mail from the iOS mail app. You would have to write your own fetcher by your self. But that wouldn’t be the only hard thing to get by. You would also have to create an HTML rendering system because Codea does not have a built in one. Another thing you would have to do is deal with Codea’s lack of native text boxes. While this would be a cool idea, I don’t think it’s a project for early coders.

Thanks Zoyt for getting back to me so quickly. The fetcher is the key. HTML rendering would not be a concern, nor text boxes. It’s the graphical relationships between contacts and timeline that is of interest. Imagine you could see and explore your mail network graphically, and search it (maybe the text box comes in there). Rendering subject clouds, rendering people connections around subjects and how they evolve over time. It certainly would be a different use of email, but it you are right. No way could I code it alone. Maybe codea is not the right starting point. But I haven’t found a better one.

Thanks again, and let me know if you know of people who are interested in such a project :slight_smile:

This would be a cool project, but if you are new to coding (I can’t tell), I don’t suggest it. What code related stuff do you know?
Anyways, I would first go along making sure that it is possible to access POP and IMAP accounts, and if you want to allow it to send emails, use SMTP and MSA. You also need to be able to deal with webmail users (Gamil, AOL Mail, Hotmail, etc.). For more basic info on what a mail client is, go here:
How I would test this is by first plugging LuaSocket (TTL: PLEASE add this to Codea [-O< ) into the Codea runtime library and trying some of these methods discussed in these threads:
(This is after a little searching… You might also try have a server that retrieves and sends mail for yu and Codea reads from there.)
If you can retrieve emails, then you know the hardest part is possible. Next, you can profess to the fun part: the cool FX.
Have a 2D table with the messages in one direction, and in the other, the title, the senders, and the body. This is where you will store the emails. Before you display the email, you probably want to strip it of all HTML (because I assume you want just plain text). This is quite simple, just a line of code that uses RegExp. Next, you’ll draw the message. There are many amazing effects in Codea… So you can explore that later.
Finally, combine the code in the Codea runtime engine. Simply (not really) make the program fetch the mail, put it in the table that you store the messages in, then draw it.
Anyways, good luck!
P.S. I think Codea might be the right place for this… At least the Codea runtime library. It’s easily extendable and you can get lots of support from this community if you have issues.
P.P.S. If you want inspiration, there are trillions of amazing Twitter teeet visualizers.