zoukankan      html  css  js  c++  java
  • iOS

    • 创建可变字符串
    • 添加收件人
    • 添加抄送人,如果没有设置成空即可
    • 添加密送,如果没有设置成空
    • 添加主题
    • 添加邮件内容 &body=<b>email</b> body! 以标签的形式添加内容.
        NSMutableString *mailUrl = [[NSMutableString alloc]init];
        //添加收件人
        NSArray *toRecipients = [NSArray arrayWithObject: @"xxxxxxx@qq.com"];
        [mailUrl appendFormat:@"mailto:%@", [toRecipients componentsJoinedByString:@","]];
        //添加抄送
        NSArray *ccRecipients = [NSArray arrayWithObjects:@"", @"", nil];
        [mailUrl appendFormat:@"?cc=%@", [ccRecipients componentsJoinedByString:@","]];
        //添加密送
        NSArray *bccRecipients = [NSArray arrayWithObjects:@"", nil];
        [mailUrl appendFormat:@"&bcc=%@", [bccRecipients componentsJoinedByString:@","]];
        //添加主题
        [mailUrl appendString:@"&subject=关于加班笔记"];
        //添加邮件内容
        [mailUrl appendString:@"&body=<b>email</b> body!"];
        NSString* email = [mailUrl stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
        [[UIApplication sharedApplication] openURL: [NSURL URLWithString:email]];
    
  • 相关阅读:
    ng-if 下ng-model失效 ng-repeat循环输出单选框
    ng-repeat输出当前值,ng-class的使用
    SQL-select中使用条件判断语句
    JS-Ajax
    ASP.NET-缓存Cache
    MVC-Filter-脚本注入
    三层架构与MVC的区别
    MVC-Route
    cookie-session
    初衷
  • 原文地址:https://www.cnblogs.com/adampei-bobo/p/7403299.html
Copyright © 2011-2022 走看看