#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:@[@"[email protected]”]]; //A NSArray of NSString instances specifying the email addresses of recipients.
[mc setCcRecipients:@[@"[email protected]”]];
[mc setBccRecipients:@[@"[email protected]"]];
[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完成、结束、竣工