[英]Issue in sending email
我正在研究一個使用Swift
發送電子郵件的示例。 我正在使用以下代碼:
@IBAction func sendMailButtonAction(sender: UIButton) {
if MFMailComposeViewController.canSendMail() {
let mail = MFMailComposeViewController()
mail.mailComposeDelegate = self
mail.setToRecipients(["abc@gmail.com"])
mail.setMessageBody("<p>You're so awesome!</p>", isHTML: true)
// mail.addAttachmentData(<#T##attachment: NSData##NSData#>, mimeType: <#T##String#>, fileName: <#T##String#>)
presentViewController(mail, animated: true, completion: nil)
} else {
print("Error Received While sending mail") }
}
當我單擊MFMailComposeViewController()的發送按鈕發送郵件時,我在設備日志中收到以下錯誤:
> 1. <Error>: 18:32:54.282 [0x16e1bb000] >vibe> Error: Empty atoms array
> 2. ERROR: [0x16e1bb000] 919: Vibe engine could not play vibe pattern, err = -50, actionID = 1001. Please file a bug.
問題出在組織的服務器防火牆上。 它阻止了服務器端口發送郵件。 嘗試使用蜂窩網絡發送郵件,並且可以正常工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.