1

In my application i use MFMailComposeViewController to send e-mail. I set subject and message body in my code, but let user choose the recipient. I want to save last recipient e-mail that user entered, so that next time when user tries to send e-mail, it would automatically fill in the 'to' field. I know how to make it fill in in code, but is it even possible to get that e-mail address in the first place?

Alice A.
  • 85
  • 1
  • 7
  • Sounds creepy to me. I mean that in a constructive way. –  Jul 28 '17 at 16:14
  • no no no, nothing creepy. it's just the thing about application, that user's (almost) always sending e-mail to same address. for example, i can hardcode my own e-mail with `mailComposer.setToRecipients()` in advance, but if i install it for my colleague, he will also be spamming my e-mail. ofc, he can enter it each time manually, but i'd like to simplify it for him – Alice A. Jul 28 '17 at 16:20
  • 1
    It's not possible, there is no way to get the recipients when composer is done as even having reference to MFMailComposeViewController you don't have property or anything to read the recipients. – Wujo Jul 28 '17 at 16:28
  • that's what i wanted to know. thank you – Alice A. Jul 28 '17 at 16:30
  • You could also ask for favorite/most used email addresses and then add them as you previously said, using `setToRecipients`. Maybe AB test it and check whether users are willing to save them or not – nathan Aug 01 '17 at 19:26

0 Answers0