0

I know there is no method in iOS for setting the From: address header in MFMailComposeViewController http://developer.apple.com/library/ios/#documentation/MessageUI/Reference/MFMailComposeViewController_class/Reference/Reference.html#//apple_ref/occ/cl/MFMailComposeViewController.

However, I can't believe it is not possible since iOS version 3.

Is there any offical way in iOS to configure the MailComposer with a specific mail account?

The business requirements for the app are: Send email using a From (or reply-to) address depending on some recipients properties.

Alfy
  • 1
  • 2
    I'm guessing this is not possible because an App could potentially enumerate the user's email addresses, which is a privacy risk. – Mike Weller Jun 27 '12 at 15:52
  • As Mike has said, this is likely not possible with a MFMailComposeViewController. However, you can do what you like if you use a different piece of code to send the email in the background, such as the accepted answer here: http://stackoverflow.com/questions/6284599/mfmailcomposeviewcontroller-question-locking-the-fields – Luke Jun 27 '12 at 16:29
  • Sending mail by smtp would mean to reimplement accout storage/mangement, secure transfer, mail queuing, code the mail window dialog etc. I think it should be raised as an enhancement at apple – Alfy Jun 28 '12 at 10:37

1 Answers1

1

Default mail accounts are predetermined in the iOS Settings. There is no way for you to programmatically select a mail account to send mail from.

WrightsCS
  • 50,551
  • 22
  • 134
  • 186