您的位置:首页 > 移动开发 > IOS开发

IOS 调用系统发邮件Api

2014-03-13 15:12 183 查看
// 判断设备是否有发送邮件功能
NSString *deviceType = [UIDevice currentDevice].model;
if([deviceType  isEqualToString:@"iPod touch"]||
        [deviceType  isEqualToString:@"iPad"]||
        [deviceType  isEqualToString:@"iPhone Simulator"])
{
UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"提示" message:@"模拟器没有发送邮件功能" delegate:nil cancelButtonTitle:@"好的,知      道了" otherButtonTitles:nil,nil];
[alert show];
return;

}
else
{

NSString *telUrl = [NSString stringWithFormat:@"mailto:%@",personInfo.email];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:telUrl]];
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: