2016-11-15 62 views
7

我使用MFMailComposeViewController发送消息的标准功能。MFMailComposeViewController错误[MC]过滤捆绑ID的邮件表帐户

我的代码:

if MFMailComposeViewController.canSendMail() 
{ 
    let mail = MFMailComposeViewController() 
    mail.mailComposeDelegate = self 
    mail.setToRecipients(["[email protected]"]) 
    mail.setSubject("Subject") 
    mail.setMessageBody("Some Text", isHTML: false) 
    self.presentViewController(mail, animated: true, completion: nil) 
} 

控制器不打开,我看到在那些从未见过的控制台的消息。

[MC]过滤邮件片占组合编号:[我的包ID],源账户管理:1

[MC]结果:NO

帮助请。

+0

我有完全相同的问题!我试过在模拟器中,它在ios 9中工作,但不在ios 10中。 –

+0

得到了解决这个问题? –

+0

仍在寻找解决方案:( – Makaille

回答

1

对于苹果斯威夫特版本3.0.1

if MFMailComposeViewController.canSendMail() 
{ 
    let mail = MFMailComposeViewController() 
    mail.mailComposeDelegate = self 
    mail.setToRecipients(["[email protected]"]) 
    mail.setSubject("Subject") 
    mail.setMessageBody("Some Text", isHTML: false) 
    self.present(mail, animated: true, completion: nil) 
} 

我有同样的错误,虽然它完美的作品我的设备上的iOS 10.1.1。 我有一个类似的问题,发现邮件编辑器只能在模拟器中的iOS 9上工作,在我现有的知识的情况下,iOS 10存在某种错误并且在模拟器上运行邮件编辑器。

0

有同样的问题。 它与演示者连接。

您需要从UINavigationController提供MFMailComposeViewController。 试试这个:

self.navigationController.presentViewController(mail, animated: true, completion: nil) 

它解决了我的问题。

0

如果在试图测试应用程序的设备上设置了邮件帐户,则不会出现问题。请创建一个邮件帐户。