发送email 打开email
2015-09-25 09:51
513 查看
+ (void)alert:(NSString *)msg
{
UIAlertView *alertView =
[[[UIAlertView alloc] initWithTitle:msg message:@"" delegate:self
cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]
autorelease];
[alertView
showWithBackground];
}
+ (void) makeCall:(NSString *)phoneNumber
{
if ([DeviceDetection
isIPodTouch]){
[UIUtils
alert:kCallNotSupportOnIPod];
return;
}
NSString* numberAfterClear =
[UIUtils cleanPhoneNumber:phoneNumber];
NSURL *phoneNumberURL =
[NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",
numberAfterClear]];
//NSURL *phoneNumberURL =
[NSURL URLWithString:[NSString stringWithFormat:@"atel:%@",
numberAfterClear]];
NSLog(@"make call, URL=%@",
phoneNumberURL);
[[UIApplication
sharedApplication] openURL:phoneNumberURL];
}
+ (void) sendSms:(NSString *)phoneNumber
{
if ([DeviceDetection
isIPodTouch]){
[UIUtils
alert:kSmsNotSupportOnIPod];
return;
}
NSString* numberAfterClear =
[UIUtils cleanPhoneNumber:phoneNumber];
NSURL *phoneNumberURL =
[NSURL URLWithString:[NSString stringWithFormat:@"sms:%@",
numberAfterClear]];
NSLog(@"send sms, URL=%@",
phoneNumberURL);
[[UIApplication
sharedApplication] openURL:phoneNumberURL];
}
+ (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]];
}
{
UIAlertView *alertView =
[[[UIAlertView alloc] initWithTitle:msg message:@"" delegate:self
cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]
autorelease];
[alertView
showWithBackground];
}
+ (void) makeCall:(NSString *)phoneNumber
{
if ([DeviceDetection
isIPodTouch]){
[UIUtils
alert:kCallNotSupportOnIPod];
return;
}
NSString* numberAfterClear =
[UIUtils cleanPhoneNumber:phoneNumber];
NSURL *phoneNumberURL =
[NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",
numberAfterClear]];
//NSURL *phoneNumberURL =
[NSURL URLWithString:[NSString stringWithFormat:@"atel:%@",
numberAfterClear]];
NSLog(@"make call, URL=%@",
phoneNumberURL);
[[UIApplication
sharedApplication] openURL:phoneNumberURL];
}
+ (void) sendSms:(NSString *)phoneNumber
{
if ([DeviceDetection
isIPodTouch]){
[UIUtils
alert:kSmsNotSupportOnIPod];
return;
}
NSString* numberAfterClear =
[UIUtils cleanPhoneNumber:phoneNumber];
NSURL *phoneNumberURL =
[NSURL URLWithString:[NSString stringWithFormat:@"sms:%@",
numberAfterClear]];
NSLog(@"send sms, URL=%@",
phoneNumberURL);
[[UIApplication
sharedApplication] openURL:phoneNumberURL];
}
+ (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]];
}
相关文章推荐
- Training
- 用fail2ban解决暴力破解,你设定成登陆失败3次封锁该IP小时,按RSA的加密等级他得算上好久
- maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-wa
- mysql failed to open file
- Async and Await 异步和等待
- RAID技术介绍和总结
- mongoDB启动报错 ERROR: child process failed, exited with error number
- http://blog.csdn.net/fufeihappy/article/details/6060763 你知道linux每个文件夹下都是什么吗?
- Factorial Trailing Zeroes
- HDU 3394 Railway(点双连通分量与桥)
- AIDL相关的解释远程service和client处理
- rotate图片旋转 http://blog.csdn.net/lonelyroamer/article/details/8252533
- MethodInvokingJobDetailFactoryBean的并发问题
- blog is waiting for you
- Could not obtain transaction-synchronized Session for current thread
- Linux sync命令的作用 http://blog.csdn.net/holandstone/article/details/7356865
- HDU 2476 String painter(记忆化搜索, DP)
- copypng emitted errors but did not return a nonzero exit code to indicate failure
- 超级块与索引节点 http://blog.csdn.net/ilsas/article/details/5627348
- TIME_WAIT状态的必要性