【问题标题】:i want to open from my aap. "settings >> mail >> add account " (the add account page) is it possible.?我想从我的 aap 打开。 “设置>>邮件>>添加帐户”(添加帐户页面)可以吗?
【发布时间】:2011-07-14 06:15:37
【问题描述】:
在我的应用程序中,如果用户没有在他们的 iPhone 上配置他们的电子邮件帐户,那么当用户打开应用程序时,它会询问电子邮件配置(意味着应用程序重定向到“设置>>邮件> > 添加帐户“添加帐户页面),
我该怎么做?
我在堆栈溢出中搜索并发现了一个类似的问题,但它没有帮助。
just like this so question
【问题讨论】:
标签:
iphone
xcode
ios4
mfmailcomposeviewcontroller
【解决方案1】:
只看官方的示例代码。这里是链接:SampleCode
找到 launchMailAppOnDevice() 函数。
// Launches the Mail application on the device.
-(void)launchMailAppOnDevice
{
NSString *recipients = @"mailto:first@example.com?cc=second@example.com,third@example.com&subject=Hello from California!";
NSString *body = @"&body=It is raining in sunny California!";
NSString *email = [NSString stringWithFormat:@"%@%@", recipients, body];
email = [email stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:email]];
}
这对我很有用。希望对你有帮助。