0

在我的 iPhone 应用程序中,我可以发送邮件。在邮件正文中,我有 url。代码如下。

- (IBAction)sendEmailClick:(UIButton *)sender{
    if ([MFMailComposeViewController canSendMail]) {

        NSString* message = @"Click link below to reach the shared file(s).<br /><br /> http://google.com <br /><br /> Do you want to try our product? Please visit <a href=\"http://www.test.com/\">http://www.test.com/</a>";        

        MFMailComposeViewController* controller = [[MFMailComposeViewController alloc] init];
        [controller setSubject:@"Shared file from App"];
        [controller setMessageBody:message isHTML:YES];
        controller.mailComposeDelegate = self;
        controller.navigationBar.tintColor = self.navigationController.navigationBar.tintColor;
        [self presentModalViewController:controller animated:YES];
    } else {
        UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"App", nil) message:NSLocalizedString(@"Your phone is not currently configured to send mail.", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles:nil];
        [alertView show];
    }
}

我已经启用了 javascript,但是在我点击邮件中的 url 后,它没有用浏览器打开。

4

0 回答 0