-1

iPhoneアプリケーションからメールアプリケーションにリダイレクトする方法は?MailComposerViewControllerのようなStackOverflowで見たことがあります。彼らはiPhoneアプリケーション内からメールを送信しています。しかし、プロジェクトを終了して、iPhoneにある組み込みのメールアプリにリダイレクトしたいのですが

これどうやってするの?

私は以下を試しました。これに必要なフレームワークはありますか?

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

}
4

1 に答える 1

2

いいえ、MFMailComposeViewControllerなしで電子メールを送信する方法に関するスタックオーバーフローの投稿はたくさんあります。実際、 16時間前にリクエストに対して、アプリを終了してメールを開始する応答が少なくとも1つありました。

これが私のアプリでそれを行う方法であり、そのままコピーされます:

-(IBAction) mailForHelp:(id)sender
{
    NSString    *urlStr = [NSString stringWithFormat:@"mailto:info@BitsOnTheGo.com?subject=NumMemorize Question"];
    NSURL* mailURL = [NSURL URLWithString:[urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
    [[UIApplication sharedApplication] openURL: mailURL];
}
于 2009-10-06T04:11:38.073 に答える