मैं ईमेल विकल्प भेजने के साथ एक ऐप स्थापित करने की कोशिश कर रहा हूं।तेजी से एक ईमेल भेजना 3
import Foundation
import MessageUI
import UIKit
class emailClass: UIViewController, MFMailComposeViewControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
if !MFMailComposeViewController.canSendMail() {
print("Mail services are not available")
return
}
sendEmail()
}
func sendEmail() {
let composeVC = MFMailComposeViewController()
composeVC.mailComposeDelegate = self
// Configure the fields of the interface.
composeVC.setToRecipients(["[email protected]"])
composeVC.setSubject("Hello!")
composeVC.setMessageBody("Hello this is my message body!", isHTML: false)
// Present the view controller modally.
self.present(composeVC, animated: true, completion: nil)
}
func mailComposeController(controller: MFMailComposeViewController,
didFinishWithResult result: MFMailComposeResult, error: NSError?) {
// Check the result or perform other tasks.
// Dismiss the mail compose view controller.
controller.dismiss(animated: true, completion: nil)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
तो मैं यह संदेश प्राप्त: "मेल सेवाओं उपलब्ध नहीं हैं"
मैं इस कोड है। अब मैंने iCloud में सिम्युलेटर डिवाइस में लॉग इन किया है ... तो मुझे लगता है कि इसे करना चाहिए लेकिन यह नहीं है। यह क्यों काम नहीं कर रहा है? क्या आप मुझे बता सकते हैं कि क्या गलत है और मैं आगे कैसे बढ़ सकता हूं?
आपको एक ईमेल पते के साथ अपने डिवाइस को कॉन्फ़िगर किया? यदि नहीं, तो यह करें ... और यह आपकी समस्या का समाधान कर सकता है। –
मैं सिम्युलेटर का उपयोग कर रहा हूँ। मैं डिवाइस को ईमेल पते से कैसे कॉन्फ़िगर कर सकता हूं? जब मैं सेटिंग्स पर जाता हूं तो मुझे विकल्प "ईमेल" नहीं दिख रहा है .... –
मैं बात करता हूं, आपने इस समस्या को हल कर लिया है .. इस बीच यहां आईओएस डिवाइस के लिए एक ईमेल कॉन्फ़िगर करने के लिए लिंक है ... https: // support। apple.com/en-in/HT201320 –