Search code examples
iphonexcodeemailuibarbuttonitemmfmailcomposeviewcontroller

how to send email using UIbarbuttonitem without using MFMailComposerViewController


I want to send email using rightBarButtonItem without using MFMailComposerViewController. Is It possible to send email using barButtonItem?

Any Idea how to do this?

thanx in advance.


Solution

  • You'll find a fantastic code sample on the accepted answer here to send a background email:

    Locking the Fields in MFMailComposeViewController

    All you need to do is setup your rightBarButtonItem's target to fire a method containing this email code, and then populate the message contents etc using the information you want to send.

    Hope this helps!