本文介绍了iOS SDK:如何调用电子邮件应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的iPad应用程序中,我想使用自定义的正文文本调用iPad的电子邮件应用程序。发件人和主题将为空,我想设置的唯一参数是电子邮件的文本。我该怎么做?

From within my iPad application I would like to invoke iPad's E-mail app with custom body text. Senders and subject will be empty, the only parameter I would like to set is the text of the e-mail message. How could I do that?

谢谢!

推荐答案

只需在您的应用程序中打开一封电子邮件作曲家?

Why not just open an email message composer inside your app?

MFMailComposeViewController *mailController = [[MFMailComposeViewController alloc] init];

[mailController setSubject:@"my subject"];                  
[mailController setMessageBody:@"my message" isHTML:NO];

mailController.mailComposeDelegate = self;

UINavigationController *myNavController = [myViewController navigationController];

if ( mailController != nil ) {
    if ([MFMailComposeViewController canSendMail]){
        [myNavController presentModalViewController:mailController animated:YES];
    }
}

[mailController release];

这篇关于iOS SDK:如何调用电子邮件应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 14:58