In this recipe, we will learn how to use the e-mail messaging interface within an application.
Perform the following steps:
Add a button on the view of
EmailMessageAppViewController
and theMonoTouch.MessageUI
namespace in theEmailMessageAppViewController.cs
file.Enter the following code in the
ViewDidLoad
method:this.btnSendEmail.TouchUpInside += async (s, e) => { if (MFMailComposeViewController.CanSendMail) { this.mailController = new MFMailComposeViewController(); this.mailController.SetToRecipients(new string[] { "[email protected]" }); this.mailController.SetSubject("Email from Xamarin.iOS!"); this.mailController.SetMessageBody("This is the message body!", false); this.mailController.Finished += this.MailController_Finished; await this.PresentViewControllerAsync(this.mailController, true); } else { Console...