【问题标题】:how to send e-mail without MFMailComposeViewController in iOS?如何在 iOS 中不使用 MFMailComposeViewController 发送电子邮件?
【发布时间】:2010-12-04 03:47:52
【问题描述】:

如何从 iPhone 应用程序重定向到邮件应用程序? 我在 Stack Overflow 中看到过类似 MailComposerViewController。 他们从 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];

}

【问题讨论】:

    标签: iphone mfmailcomposeviewcontroller


    【解决方案1】:

    不,有很多关于如何在没有 MFMailComposeViewController 的情况下发送电子邮件的 stackoverflow 帖子。其实your request 16 hours earlier that would quit your app and start Mail至少有一个回复

    这是我在应用程序中的操作方式,完全照原样复制:

    -(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];
    }
    

    【讨论】:

    • 我做到了 NSString *_recipient = @"someone@email.com"; NSURL *_mailURL = [NSURL URLWithString:[NSString stringWithFormat:@"mailto:%@?subject=My Subject", _recipient]]; [[UIApplication sharedApplication] openURL:_mailURL];但它没有给出输出......我在上面的东西上编码的按钮上创建......
    • 这在模拟器中没有任何作用。在 iPhone 上,它应该退出您的应用并启动 Mail。
    猜你喜欢
    • 2012-02-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-06
    • 2015-11-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多