Get default email on iOS device

Can I get the userโ€™s email associated with the default email account directly from the application?

Screenshot:

enter image description here

Thanks.

+7
source share
2 answers

I cannot prove a negative result, but I am sure that this is impossible. You can use MFMailComposeViewController to allow the user to send email from the default account, but you cannot directly access the default account information. If you need a userโ€™s email address, you either need to ask them to enter it, or select it from your contacts.

+6
source

In addition to @woz's answer, this is the point that can help you.

In my application, I have a feedback form so that users can contact me. Unfortunately, many users had minor spelling errors in their email addresses, and I could not contact them.

Since I could not get the perfect way to make sure the letter was correct, I developed the following text, which:

  • claims mail is valid foo@bar.tld
  • verifies that the message is in the user's address book
  • If not, suggest the closest match.

Again, this is far from ideal, and I turned on this behavior (a small "check mail" button next to the UITextField)

https://gist.github.com/dirtyhenry/7547064

+6
source

All Articles