IOS-Frameworks-MessageUI-MFMailComposeViewController

#import <MessageUI/MessageUI.h> // MessageUI.Frameworks

/*

    @header     MFMailComposeViewController

    @abstract   The MFMailComposeViewController class provides an interface for editing and sending email.

    @discussion MFMailComposeViewController is used for implementing a simple interface for users to enter and send email.

*/

¥[import] A. |ˈɪmpɔːt|noun进口、进口货物、输入劳务 B. |ɪmˈpɔːt|transitive verb进口、引进、输入

¥[discussion] |dɪˈskʌʃn| noun讨论 a discussion about [somebody]/[something]论述

¥[compose] |kəmˈpəʊz| transitive verb组成、创作、撰写、构思

¥[abstract] A. |ˈæbstrækt|adj抽象的、理论上的、抽象(派)的、抽象的 B. |ˈæbstrækt|noun抽象、摘要

¥[implement] A. |ˈɪmplɪmənt|noun工具 a farm implement 农具、a set of implements一套工具 B. |ˈɪmplɪment|transitive verb实施、实践、执行

¥[specify] |ˈspesɪfaɪ| transitive verb具体说明 as specified above 如上所述、not specified elsewhere未在别处说明的

¥[recipient] |rɪˈsɪpɪənt| noun接受者

¥[copy in]:抄送 send a copy of the document to all departments将文件抄送各部门

¥[blind carbon copy] :密送

¥[carbon copy]:抄送

¥[carbon] [ˈkɑ:rbən]  n. [化学]; adj.碳的碳处理的

¥[blind] |blaɪnd|A.adjective 失明的 a blind man/woman

¥[prior] |ˈpraɪə(r)| adjective在先的 prior notice 预先通知、优先的


(void)sendMailExample {

    Class mailClass = NSClassFromString(@"MFMailComposeViewController");

    if (mailClass!=nil) {

        if ([MFMailComposeViewControllercanSendMail]) {

            MFMailComposeViewController *mc = [[MFMailComposeViewControlleralloc]init];

            mc.mailComposeDelegate =self;

            [mc setToRecipients:@[@"zhouhaoranxin@yeah.net”]];    //A NSArray of NSString instances specifying the email addresses of recipients.

            [mc setCcRecipients:@[@"zhouhaoranxin@yeah.net”]];

            [mc setBccRecipients:@[@"zhouhaoranxin@yeah.net"]];

            [mc setMessageBody:@"body"isHTML:NO];

            [mc setSubject:@"来自MemoryApp”];    //This method will set the Subject header for the email message.  This should be called prior to display. Newlines are removed from the parameter. After the view has been presented to the user, this method will no longer change the value.

            NSData *data = [bodydataUsingEncoding:NSUTF8StringEncoding];

            [mc addAttachmentData:datamimeType:@""fileName:@"MemoryApp.txt"];

            [selfpresentViewController:mcanimated:YEScompletion:nil];

        }

    }

}


¥[attachment] |əˈtætʃmənt| noun附加装置、附件

¥[mime] [maɪm]  n.笑剧、笑剧演员、哑剧、哑剧演员 n.多用途Internet邮件扩展


- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error {

    switch (result) {

        caseMFMailComposeResultCancelled:

            NSLog(@"cancel.......");

            break;

        caseMFMailComposeResultSaved:

            NSLog(@"save.....");

            break;

        caseMFMailComposeResultFailed:

            NSLog(@"fail.....:%@",error);

            break;

        caseMFMailComposeResultSent:

            NSLog(@"send.....");

            break;

        default:

            break;

    }

    [controller dismissViewControllerAnimated:YEScompletion:nil];

}


¥[dismiss] |dɪsˈmɪs| transitive verb彻底忘掉、清除、解雇、让离开

¥[completion] |kəmˈpliːʃn| noun Uncountable完成、结束、竣工

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值