楼主:
areyo (没有名字的怪物)
2017-04-01 11:10:51各位午安
来请教个问题,想用uiactivityviewcontroller 然后选择mail去寄信
指定好主题、内文及附档,那么怎么指定收件人的email?
大多看stackoverflow都是讲如何设定内文及主题
UIActivityViewController *shareController;
[shareController setvalue:@"Title" forKey:@"subject"];
但却不知道寄件者是该写怎样的key?? 试过"to",但会当掉
再麻烦有经验的指导,谢谢
作者: johnny78615 (Johnny) 2017-04-01 11:45:00
这是我的写法,是swift的,你参考看看let mailVC = MFMailComposeViewController()if MFMailComposeViewController.canSendMail() {mailVC.delegate = self//don't forgot this!!!mailVC.mailComposeDelegate = selfmailVC.setToRecipients([your email”]) mailVC.setSubject(“your mail title”) mailVC.setMessageBody(“mail body ", isHTML: false) self.presentViewController(mailVC, animated: true, completion: nil) }