//import MessageUI 하기
import UIKit
import MessageUI
// MFMailComposeViewControllerDelegate 추가
class OptionpageViewController: UIViewController, MFMailComposeViewControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
}
...
}
//Email Send 함수 설정
func EmailSend(_ sender: AnyObject){
let mailVC = MFMailComposeViewController()
mailVC.mailComposeDelegate = self
mailVC.setToRecipients(["yourEmail@xxx.xx"])
mailVC.setSubject("")
mailVC.setMessageBody("Your messagge", isHTML: false)
present(mailVC, animated: true, completion: nil)
// 2016.12.2 수정 앱 심사중에 네트워크 충돌로 거부사유 됨 아래코드 활용
if MFMailComposeViewController.canSendMail(){
self.present(mailVC, animated: true, completion: nil)
}
//Email Send 함수 설정
func EmailSend(_ sender: AnyObject){
let mailVC = MFMailComposeViewController()
mailVC.mailComposeDelegate = self
mailVC.setToRecipients(["yourEmail@xxx.xx"])
mailVC.setSubject("")
mailVC.setMessageBody("Your messagge", isHTML: false)
// 2016.12.2 수정 앱 심사중에 네트워크 충돌로 거부사유 됨 아래코드 활용
if MFMailComposeViewController.canSendMail(){
self.present(mailVC, animated: true, completion: nil)
}
}
// mailComposeController 델리게이트 메소드 활용하여 창 닫기 함수 설정
func mailComposeController(_ controller: MFMailComposeViewController,
didFinishWith result: MFMailComposeResult, error: Error?) {
controller.dismiss(animated: true, completion: nil)
}
}
// mailComposeController 델리게이트 메소드 활용하여 창 닫기 함수 설정
func mailComposeController(_ controller: MFMailComposeViewController,
didFinishWith result: MFMailComposeResult, error: Error?) {
controller.dismiss(animated: true, completion: nil)
}
댓글 없음:
댓글 쓰기