博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
MFMailComposeViewController 发邮件
阅读量:6213 次
发布时间:2019-06-21

本文共 2329 字,大约阅读时间需要 7 分钟。

hot3.png

#pragma mark - feedback- (void)sendFeedBackMail{        MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];    picker.mailComposeDelegate = self;    [picker setSubject:@"subjbect"];    picker.navigationBar.tintColor = [UIColor colorWithRed:kScreenR/255.0                                                     green:kScreenG/255.0                                                      blue:kScreenB/255.0                                                     alpha:0.5];    NSArray *toRecipients = [NSArray arrayWithObject:@"xx@xx.com"];    [picker setToRecipients:toRecipients];    NSString *emailBody = [NSString                           stringWithFormat:@"SystemVersion: %@ \n AppVersion: %@ \n 反馈信息:\n",                                           [[UIDevice currentDevice] systemVersion],                           [[[NSBundle mainBundle] infoDictionary]                            objectForKey:@"CFBundleShortVersionString"]];    [picker setMessageBody:emailBody isHTML:NO];    [self presentModalViewController:picker animated:NO];}#pragma mark - MFMailComposeViewControllerDelegate- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error{    NSString *title = @"邮件发送提醒";    NSString *msg;    switch (result){        case MFMailComposeResultCancelled:            msg = @"邮件已被取消";            break;        case MFMailComposeResultSaved:            msg = @"邮件保存成功";            [self alertWithTitle:title msg:msg];            break;        case MFMailComposeResultSent:            msg = @"邮件发送成功";            [self alertWithTitle:title msg:msg];            break;        case MFMailComposeResultFailed:            msg =@"邮件发送失败";            [self alertWithTitle:title msg:msg];            break;        }          [self dismissModalViewControllerAnimated:YES];    }- (void) alertWithTitle: (NSString *)_title_ msg: (NSString *)msg{    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:_title_                                                    message:msg                                                   delegate:nil                                          cancelButtonTitle:@"好"                                          otherButtonTitles:nil];    [alert show];}

转载于:https://my.oschina.net/brucezcq/blog/148914

你可能感兴趣的文章
C++ 智能指针(一)
查看>>
移动端webapp开发必备知识[转]
查看>>
前端之js动画-47
查看>>
CSS中position的absolute和relative的应用
查看>>
树莓派Linux下无线网卡无法获取IP,不识别,等问题
查看>>
双重指针法,分配二维数组内存
查看>>
memcached总结
查看>>
Java基础知识总结二(2)
查看>>
闰年 的方法 和你生存了多少天的 方法
查看>>
课程作业01:模仿JavaAppArguments.java示例,编写一个程序,此程序从命令行接收多个数字,求和之后输出结果。...
查看>>
thunder
查看>>
更新CM版本
查看>>
Dubbo面试题
查看>>
BZOJ 2671 Calc
查看>>
Oracle - 使用序列+触发器实现主键自增长
查看>>
考勤助手——时序图设计
查看>>
java中entity和object的区别
查看>>
11.12
查看>>
Neo4j 第五篇:批量更新数据
查看>>
《网络攻防技术与实践》 第十一、十二章课后实践
查看>>