作者:
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) }