iOS:如何通过MFMailComposeController发送消息后如何获取消息正文,主题和收件人 [英] IOS: How to get message body, subject and recepient after message is sent via MFMailComposeController

查看:103
本文介绍了iOS:如何通过MFMailComposeController发送消息后如何获取消息正文,主题和收件人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过以下方法发送电子邮件:

I am sending email via following method:

-(void) sendEmailOpenControllerWithSubject:(NSString *)subject messsageBody:(NSString *) message
{
    MFMailComposeViewController* controller = [[MFMailComposeViewController alloc] init];
    controller.mailComposeDelegate = self;
    [controller setSubject:subject];
    [controller setMessageBody:message isHTML:NO];
    [controller setToRecipients:[[NSArray alloc] initWithObjects:currentProspect.email, nil]];
    if (controller) [self presentModalViewController:controller animated:YES];
}

我正在设置邮件正文主题和收件人,但是用户可能会在MailComposer中更改这些属性.

I am setting message body subject and recipient but it is likely that user changes these attribute in MailComposer.

我需要什么:

因此,我想在发送电子邮件后获取诸如邮件正文,主题和收件人之类的内容.用户可能已通过邮件编辑器更改了这些设置.

So I want to get the contents like message body,subject and recipients after the email is sent. As it is possible that user has changed these via mail composer.

推荐答案

从iOS 5开始,您可以注册以接收有关文本消息发送可用性的更改的通知.

Starting in iOS 5, you can register to be notified of changes to the availability of text message sending.

A userInfo dictionary key for the MFMessageComposeViewControllerTextMessageAvailabilityDidChangeNotification

NSString *const MFMessageComposeViewControllerTextMessageAvailabilityKey;

有关Message UI Framework的更多信息,请参见此处

Refer more on Message UI Framework here

这篇关于iOS:如何通过MFMailComposeController发送消息后如何获取消息正文,主题和收件人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆