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]];
    
  • 相关阅读:
    shell
    regionMatches方法
    ==
    使用INTO子句创建新表
    数据库除运算
    数据库笛卡尔积运算
    人生格言
    刚开通~
    Nginx:413 Request Entity Too Large
    ORACLE 查看并修改最大连接数
  • 原文地址:https://www.cnblogs.com/adampei-bobo/p/7403299.html
Copyright © 2011-2022 走看看