MFMailComposeViewController发送邮件的实例
来源:互联网 发布:淘宝类目排行榜 编辑:程序博客网 时间:2024/06/08 12:26
#pragma mark - feedback
02
03
- (
void
)sendFeedBackMail{
04
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
05
picker.mailComposeDelegate = self;
06
[picker setSubject:@
"subjbect"
];
07
picker.navigationBar.tintColor = [UIColor colorWithRed:kScreenR/255.0
08
green:kScreenG/255.0
09
blue:kScreenB/255.0
10
alpha:0.5];
11
NSArray *toRecipients = [NSArray arrayWithObject:@
"xx@xx.com"
];
12
[picker setToRecipients:toRecipients];
13
NSString *emailBody = [NSString
14
stringWithFormat:@
"SystemVersion: %@ \n AppVersion: %@ \n 反馈信息:\n"
, [[UIDevice currentDevice] systemVersion],
15
[[[NSBundle mainBundle] infoDictionary]
16
objectForKey:@
"CFBundleShortVersionString"
]];
17
[picker setMessageBody:emailBody isHTML:NO];
18
[self presentModalViewController:picker animated:NO];
19
}
20
21
#pragma mark - MFMailComposeViewControllerDelegate
22
- (
void
)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error{
23
NSString *title = @
"邮件发送提醒"
;
24
NSString *msg;
25
switch
(result){
26
case
MFMailComposeResultCancelled:
27
msg = @
"邮件已被取消"
;
28
break
;
29
case
MFMailComposeResultSaved:
30
msg = @
"邮件保存成功"
;
31
[self alertWithTitle:title msg:msg];
32
break
;
33
case
MFMailComposeResultSent:
34
msg = @
"邮件发送成功"
;
35
[self alertWithTitle:title msg:msg];
36
break
;
37
case
MFMailComposeResultFailed:
38
msg =@
"邮件发送失败"
;
39
[self alertWithTitle:title msg:msg];
40
break
;
41
}
42
43
[self dismissModalViewControllerAnimated:YES];
44
45
}
46
47
- (
void
) alertWithTitle: (NSString *)_title_ msg: (NSString *)msg{
48
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:_title_
49
message:msg
50
delegate:nil
51
cancelButtonTitle:@
"好"
52
otherButtonTitles:nil];
53
[alert show];
54
}
- MFMailComposeViewController发送邮件的实例
- MFMailComposeViewController发送邮件的实例
- MFMailComposeViewController发送邮件的实例
- MFMailComposeViewController发送邮件的实例
- MFMailComposeViewController发送邮件的实例
- MFMailComposeViewController发送邮件的实例
- MFMailComposeViewController发送邮件的实例
- iOS开发 MFMailComposeViewController(发送邮件)的使用
- 发送邮件--MFMailComposeViewController
- 集成邮件发送功能MFMailComposeViewController
- 如何将MFMailComposeViewController的发送邮件界面设为中文
- 使用MFMailComposeViewController发送邮件时防止崩溃
- iOS开发笔记之二十五——MFMailComposeViewController发送邮件实例
- 发送邮件的实例
- MFMailComposeViewController 如何发送带有图片的html
- JavaMail 发送邮件的实例
- MFMailComposeViewController 发邮件
- javamail发送邮件的简单实例
- 工作之感慨~~~~~~~
- xmln:tools的作用
- 图像的二维DFT及其反变换
- 【分享】某卖鞋电商的用户搜索日志
- Python中的浅拷贝与深拷贝
- MFMailComposeViewController发送邮件的实例
- C++ 构造函数初始化列表
- vmware ubuntu扩展硬盘
- GetLastError()返回值列表
- Class.forName的作用以及为什么要用它【转】
- Android AppWidget实例验证
- mysql 触发器 NEW OLD
- Git 常用命令
- 推荐一些计算机视觉相关的书籍