1

这是我的代码..

if ([ [ requestURL scheme ] isEqualToString: @"mailto" ])

 {

        MFMailComposeViewController *composer = [[MFMailComposeViewController alloc] init];
        [composer setMailComposeDelegate:self];
        if ([MFMailComposeViewController canSendMail]) {
            NSString *strEmail = [NSString stringWithFormat:@"%@",requestURL];
            NSString *subString = [[strEmail componentsSeparatedByString:@":"] lastObject];
            [composer setToRecipients:[NSArray arrayWithObjects:subString, nil]];
            [composer setSubject:@"Kreativ-Q"];
            [composer setMessageBody:@"" isHTML:YES];
            [composer setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
            [self presentModalViewController:composer animated:YES];
            [composer release];
        }
    }

但是当我点击 webview 中的链接时,它会在邮箱中打开。当我从那里发送或取消邮件并返回我的应用程序时,邮件仍然存在。他们给我看了两次。我只是想要,它只会在我的应用程序中打开..

提前致谢。

4

1 回答 1

0

可以帮助您:

如果您没有,请在您的 .h 文件中设置此委托。

<MFMailComposeViewControllerDelegate>
于 2013-02-11T10:53:24.437 回答