美文网首页
iOS调用系统邮箱

iOS调用系统邮箱

作者: 王正魁 | 来源:发表于2019-03-13 12:23 被阅读0次

/**

 recipients:收件人

 subject :主题

 messageBody :内容

 */

+ (MFMailComposeViewController*)launchMailAppDelegateRecipients:(NSArray *)recipients subject:(NSString*)subject messageBody:(NSString*)messageBody delegate:(id)obj

{

    MFMailComposeViewController *picker = nil;

    if([MFMailComposeViewController canSendMail]) {// 判断设备是否支持发送邮件

        // 创建对象

        picker = [[MFMailComposeViewController alloc]init];

        // 设置代理

        picker.mailComposeDelegate= obj;

        picker.navigationBar.tintColor= [UIColor blackColor];

        // 设置收件人

        [pickersetToRecipients:recipients];

        // 设置主题

        [pickersetSubject:subject];

        // 设置邮件内容

        [pickersetMessageBody:messageBodyisHTML:NO];

    }

    else{

        [MBProgressHUD ll_showErrorMessage:@"请先设置登录邮箱号"];

    }

    returnpicker;

}

//调用系统打电话:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"telprompt:400-000-1110"]];

相关文章

网友评论

      本文标题:iOS调用系统邮箱

      本文链接:https://www.haomeiwen.com/subject/kfyzpqtx.html