【问题标题】:How to make the email open in the app when in mobile在移动设备中如何使电子邮件在应用程序中打开
【发布时间】:2017-11-14 03:37:47
【问题描述】:

我想在我的电子邮件中集成一个按钮,这样当用户从桌面浏览器单击它时,该按钮会在浏览器本身中打开。

如果用户从移动设备上查看它,应该在应用程序中打开。

我该怎么做?

【问题讨论】:

  • mailt0: 也适用于 android

标签: android html ios email


【解决方案1】:

你可以试试这个: 不要忘记声明它的委托。

if ([MFMailComposeViewController canSendMail]) {
        MFMailComposeViewController * emailController = [[MFMailComposeViewController alloc] init];
        emailController.mailComposeDelegate = self;

        [emailController setSubject:subject];
        [emailController setMessageBody:mailBody isHTML:YES];   
        [emailController setToRecipients:recipients];

        [self presentViewController:emailController animated:YES completion:nil];

        [emailController release];
    }
    // Show error if no mail account is active
    else {
        UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:@"Warning" message:@"You must have a mail account in order to send an email" delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", @"OK") otherButtonTitles:nil];
        [alertView show];
        [alertView release];
    }

【讨论】:

    猜你喜欢
    • 2021-12-29
    • 1970-01-01
    • 2020-09-15
    • 2018-05-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多