首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

发送短信,发邮件,通电话代码实现

2012-06-29 
发送短信,发邮件,打电话代码实现基础代码:打电话:+ (void) sendEmail:(NSString *)phoneNumber{NSURL *pho

发送短信,发邮件,打电话代码实现
基础代码:



打电话:
    + (void) sendEmail:(NSString *)phoneNumber    {        NSURL *phoneNumberURL = [NSURL URLWithString:[NSString stringWithFormat:@"mailto:%@", phoneNumber]];        NSLog(@"send sms, URL=%@", phoneNumberURL);        [[UIApplication sharedApplication] openURL:phoneNumberURL];       }    + (void) sendEmail:(NSString *)to cc:(NSString*)cc subject:(NSString*)subject body:(NSString*)body    {        NSString* str = [NSString stringWithFormat:@"mailto:%@?cc=%@&subject=%@&body=%@",                         to, cc, subject, body];        str = [str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];               [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];           }

热点排行