IOS: How to get message body, subject and recepient after message is sent via MFMailComposeController

狂风中的少年 提交于 2019-12-25 11:53:22

问题


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];
}

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

What I need:

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.


回答1:


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;

Refer more on Message UI Framework here



来源:https://stackoverflow.com/questions/12639990/ios-how-to-get-message-body-subject-and-recepient-after-message-is-sent-via-mf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!