[英]SKSMTPMessage Error- The operation couldn't be completed.(OSStatus error -9807.)
Can anyone please help me to understand the error- “ The operation couldn't be completed.(OSStatus error -9807.) ”. 谁能帮我理解错误“ 操作无法完成。(OSStatus错误-9807。) ”。
I googled & found, except SkSMTPMessage
, sometimes this error comes in AVAudioPlayer
class but the number is different ie 9800 . 我用Google搜索并发现,除了
SkSMTPMessage
之外,有时此错误出现在AVAudioPlayer
类中,但数量不同,即9800 。
My questions are, A) would you please tell, what is significant of number here, B) why such error occurs in code? 我的问题是, A)请问,这里的数字有什么重要意义, B)为什么这样的错误在代码中发生?
I found one solution here- 我在这里找到了一种解决方案 -
It seems there are some compatability issues with iOS 5+ or later and this smtp app because iOS started using TLS 1.2. 似乎iOS 5+或更高版本以及此smtp应用程序存在一些兼容性问题,因为iOS开始使用TLS 1.2。
find the source in the SKPSMTPMessage.m
, and modify the source like following, it works 在
SKPSMTPMessage.m
找到源,然后按如下所示修改源,它可以工作
//CFDictionarySetValue(sslOptions, kCFStreamSSLLevel, kCFStreamSocketSecurityLevelTLSv1);
CFDictionarySetValue(sslOptions, kCFStreamSSLLevel, kCFStreamSocketSecurityLevelSSLv3);
It didn't work in my case. 就我而言,它不起作用。
In the case, when i tried to send email with my gmail
account it worked , but when I tried to send it from my companies SMTP
credentials, it didn't work. 在这种情况下,当我尝试使用
gmail
帐户发送电子邮件时,它可以正常工作 ;但是,当我尝试从公司的SMTP
凭据中发送电子邮件时,则无法正常工作。
How can I solve such issue from my app? 如何从我的应用程序解决此类问题?
It might be caused by SSL certificate. 这可能是由SSL证书引起的。 I have encountered the same issue and it turned out that my server is using self-signed SSL certificate and iOS has trouble with it.
我遇到了同样的问题,事实证明我的服务器使用的是自签名SSL证书,iOS遇到了麻烦。
Add this line: 添加此行:
// Only do this for self-signed certs!
emailMessage.validateSSLChain = NO;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.