我正在制作一个使用@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") }
}
发送电子邮件的示例。我使用以下代码:
> 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.
当我单击MFMailComposeViewController()的发送按钮发送邮件时,我在设备日志中收到错误:
{{1}}
答案 0 :(得分:0)
问题在于组织的服务器防火墙。它阻止服务器端口发送邮件。试图使用蜂窝网络发送邮件,它工作。