2009-10-06 79 views
-1

如何从iPhone应用程序重定向到邮件应用程序? 我已经看到像堆栈溢出MailComposerViewController。 他们正在iPhone应用程序内发送电子邮件。但是我想退出项目并将其重定向到内置的邮件应用程序这是在iPhone中吗?如何在iOS中没有MFMailComposeViewController的情况下发送电子邮件?

我该怎么做?

我试过以下。有没有这样的框架?

- (IBAction)ddd:(id)sender 
{ 
    NSString *_recipient = @"[email protected]"; 
    NSURL *_mailURL = [NSURL URLWithString:[NSString stringWithFormat:@"mailto:%@?subject=My Subject", _recipient]]; 
    [[UIApplication sharedApplication] openURL:_mailURL]; 

} 

回答

2

不,有很多关于如何发送没有MFMailComposeViewController的电子邮件stackoverflow帖子。事实上,有至少一个响应your request 16 hours earlier that would quit your app and start Mail

这里是我怎么做我的应用程序,精确复制,因为它是:

-(IBAction) mailForHelp:(id)sender 
{ 
    NSString *urlStr = [NSString stringWithFormat:@"mailto:[email protected]?subject=NumMemorize Question"]; 
    NSURL* mailURL = [NSURL URLWithString:[urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; 
    [[UIApplication sharedApplication] openURL: mailURL]; 
} 
+0

我做到了像 的NSString * _recipient = @“有人@电子邮件.COM“; NSURL * _mailURL = [NSURL URLWithString:[NSString stringWithFormat:@“mailto:%@?subject = My Subject”,_recipient]]; [[UIApplication sharedApplication] openURL:_mailURL]; 但它没有给出输出......我创建的按钮,其中我编码以上的东西... – 2009-10-06 04:24:26

+2

这不会在模拟器中做任何事情。在iPhone上,它应该退出你的应用程序并启动邮件。 – mahboudz 2009-10-06 06:37:45

相关问题