简体   繁体   English

SKSMTPMessage错误-无法完成该操作。(OSStatus错误-9807。)

[英]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.

相关问题 MidiClientCreate“操作无法完成。 (OSStatus错误-50。)” - MidiClientCreate “The operation couldn't be completed. (OSStatus error -50.)” 该操作无法完成。 (OSStatus错误-10827。) - The operation couldn’t be completed. (OSStatus error -10827.) 操作无法完成。 (OSStatus 错误 2003334207。) - The Operation Couldn’t Be Completed. (OSStatus Error 2003334207.) 操作无法完成。 (OSStatus 错误 -54。) - The operation couldn’t be completed. (OSStatus error -54.) -canOpenURL:URL 失败:“fbauth2:/” - 错误:“操作无法完成。(OSStatus 错误 -10814。) - -canOpenURL: failed for URL: "fbauth2:/" - error: "The operation couldn’t be completed. (OSStatus error -10814.) 音频播放器错误:操作无法完成。 (OSStatus 错误 2003334207。) - audioPlayer error: The operation couldn’t be completed. (OSStatus error 2003334207.) AVAudioPlayer失败,并显示错误“操作无法完成。 (OSStatus错误2003334207。)” - AVAudioPlayer fails with error “The operation couldn’t be completed. (OSStatus error 2003334207.)” iOS 5.0 AVAudioPlayer加载音频片段时出错:无法完成该操作。 (OSStatus错误-50。) - iOS 5.0 AVAudioPlayer Error loading audio clip: The operation couldn’t be completed. (OSStatus error -50.) “comgooglemaps://” - 错误:“操作无法完成。 (OSStatus错误-10814。)“ - “comgooglemaps://” - error: “The operation couldn’t be completed. (OSStatus error -10814.)” 操作无法完成。 (OSStatus 错误 -600。)无法在模拟器中运行应用程序 - The operation couldn’t be completed. (OSStatus error -600.) Cant run app in simulator
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM