objective-ciosxcodemfmailcomposer

Sending an Email Behind the Scenes


I am currently trying to figure out how to send an email behind the scenes. Basically, I don't want an MFMailComposeViewController popping up making me press the send button. All the fields are pre-populated so there is no need to type anything out. Is this possible? Will I have to use another framework?

Thanks


Solution

  • You'll have to use your own mail server (or ask the user for credentials for their own, which you probably don't want to do). The iOS SDK intentionally doesn't allow you to send an email on behalf of the user with no user interface; making the user press "Send" is the whole idea so that they are never surprised.

    Apps that push email out automatically either do so from their own servers, or integrate with a server framework like Mailgun, or Parse, or etc, that offer this feature.