Getting email account details

I want to create an app that retrieves a list of emails from the server so I can decide whether to delete them before I have to download them. I can dump the spam early that way.

Can anyone give me any pointers as to how I might be able to get the login details from Settings-> Accounts for my defined email accounts? I’m not even sure if I can read these but I would prefer to get them from there than to prompt the user for them and have to store them securely myself.


@barnettsab Thanks very much for your question!

What you would need for an app like this is to have access to a web service which sends the email data to you in response to a request. Typically, email providers do NOT share this information with anyone else for obvious, security reasons. The only way typically you could do this, if you yourself were the provider.

Apple does provide an API to allow developers to build apps which allow the user to SEND email, but this is obviously different from what you’re trying to do.

You unfortunately, are also trying to go one step further and trying to get the login credentials from Apple’s mail app. More than likely, this won’t be possible :frowning: I say that because of the implications: developers could potentially build apps which could take a user’s login information for their email account(s), and access them. You may have altruistic purposes, but unfortunately all it takes is one nefarious developer with dark motives to exploit this opportunity for their advantage.

This is reality.

At the end of the day, I would encourage you to leave the spam filtering to the email providers :slight_smile:

I hope this helps!

All the best!

Hi @barnettsab,
What you are describing is an email client that only displays the subject rather than the entire email. You can do that with most email clients like Apple Mail where you can switch off the preview so it only shows you a list of emails.

You can also do the same on the iOS devices.



I currently use a tool called MailWasher to preview my email. This gives me access to the data from the headers and the first part of the email. By dong this, I get to preview the content and, if it’s spam or a virus, I can delete it before it gets onto my device.

I specifically need two facilities that I don’t think mail provides. Plain text view of the header and first 1k of the email and the ability to delete off the server.

My isp does some spam filtering, but not enough. It’s also the case that many of my emails can be scanned and thrown away, which I can do with MailWasher.

MailWasher, however, relies on a third party web service to whom I have to give my mail login details. It can als be a little slow and sometimes takes a while to refresh. So I want something of my own that goes direct.

I’m pretty sure I can get my emails using existing libraries. I also know that my iPad already has my mail account details. What I want to avoid is writing yet another system for entering these details and inventing yet another secure way to save those login details.

I’ve founds let’s f articles on sending emails, found a library to read emails but nothing on how I can get my own account details.

This topic was automatically closed after 166 days. New replies are no longer allowed.