在邮件正文中打开网址

时间:2013-03-26 11:13:39

标签: iphone ios objective-c

在我的iPhone应用程序中,我有可能发送邮件。在邮件正文中我有网址。代码就像轰鸣声。

- (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后,它无法通过浏览器打开。

0 个答案:

没有答案