1

I'm creating an Android application that has a requirement to send and receive email.

I'm wondering if it is possible to retrieve the email addresses (and IMAP/POP3/Exchange configuration) that the user has entered on their phone?

It would be nice to not have the user set up their email accounts again (and me not have to develop the config screens).

eldarerathis
  • 35,455
  • 10
  • 90
  • 93
Brian DiCasa
  • 9,369
  • 18
  • 65
  • 97
  • you can read emails via http://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.Email.html and send emails via intent http://stackoverflow.com/questions/9832450/how-to-send-email-to-specific-email - if you want more than that you'll need your own mail implementation e.g. http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-built-in-a/2033124#2033124 – zapl Aug 14 '12 at 18:37
  • @zapi: Your first link if for reading email addresses of contacts, not the user. – CommonsWare Aug 14 '12 at 18:42
  • All helpful links, thanks zapl. The closest to what I want to do is the last link provided. However, I'm wondering if it is possible to retrieve the user's email configuration (that they set up through the android email app) so the user doesn't have to configure their emails again in my app. – Brian DiCasa Aug 14 '12 at 19:06

1 Answers1

2

At most, you might be able to get some email addresses via the account management system, if you have the requisite permissions, and for those email apps that happen to use the account management system. You will not be able to get passwords, for obvious reasons.

As far as "IMAP/POP3/Exchange configuration", you cannot get that for Gmail, or the AOSP email app. If third-party apps happen to have a secured API for exposing that information, you can use that, though I suspect few offer this.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491