access default email address

后端 未结 3 1463
庸人自扰
庸人自扰 2020-12-31 23:14

I am using the MFMailComposeViewController in 3.0 to send an email with attachment etc. inside my app. I would like the \"To:\" address to be defaulted to the default accou

相关标签:
3条回答
  • 2020-12-31 23:35

    You can use ABGetMe for iOS to get the user's address book card. Have a look at the source code, you will see how to retrieve all e-mail addresses for a given ABRecordRef.

    0 讨论(0)
  • 2020-12-31 23:52

    It appears that the accepted answer is wrong

    Getting user's default email address in Cocoa

    This answer shows the code for getting the e-mail address from the address book ( listed under 'me' )

    EDIT: Note the comment! OSX only not iOS :|

    0 讨论(0)
  • 2020-12-31 23:55

    The API doesn't expose that information publicly (for probably good reasons, such as preventing developers from harvesting iPhone users' email addresses).

    You should probably go about asking for the user's email address and then saving it for future use.

    0 讨论(0)
提交回复
热议问题