We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

AuthenticationException on GetMessageCount

I am trying to get message from qq.com server,try several times,can get message,but exception occurred frequently.
Please help

Pop3Client pop3Client = null;
pop3Client = new Pop3Client("xx@qq.com", int.Parse(mPort), _email, mStrPass, _ssl == false ? SecurityOptions.Auto : SecurityOptions.SSLImplicit);
pop3Client.ConnectionTimeout = _receiveTimeout * 60 * 1000;
count = pop3Client.GetMessageCount();

—> AsposeException: 调用 SSPI 失败,请参见内部异常。
—> System.Security.Authentication.AuthenticationException: 调用 SSPI 失败,请参见内部异常。 —> System.ComponentModel.Win32Exception: 给函数提供的标志无效
— 内部异常堆栈跟踪的结尾 —
在 System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception)
在 System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
在 #=q8kys5Zf2j57TUKcEbGfY7Ip1R0XgGVj4kbNOBpmRWtA=.#=qfmKAvjCxnr9DSIYYIpJGDOTE9cFiV1wSwzI5c5hR8mY=(Object #=qHujO40Z0iE9rZcHLP3nK3w==)
在 #=q8kys5Zf2j57TUKcEbGfY7Ip1R0XgGVj4kbNOBpmRWtA=.#=qS7bvfpsLjOAyk4n8qSTX7w==()
在 #=q8kys5Zf2j57TUKcEbGfY7Ip1R0XgGVj4kbNOBpmRWtA=.Read(Byte[] #=qZgyQD45x$IDIZXTLPrqOlw==, Int32 #=qRU2MepnR5CqKeB07D_yftQ==, Int32 #=qp9mR6MZYVSbUZb20GMd1Bw==)
在 #=q7Y6ZWWQJ1ws2E7Pu8Bh2so62rQ9EWeaG9iinVORST$M=.Read(Byte[] #=qZgyQD45x$IDIZXTLPrqOlw==, Int32 #=qRU2MepnR5CqKeB07D_yftQ==, Int32 #=q1nEEsJtf_mH8RL3usbGCfQ==)
在 #=qxboulPdRtGL88n3tiMjPVvBXgtEnnbPfn1S8U2VTvaQ=.#=qIw_6PbYTXJudM8SPXVkA0A==(Byte[] #=qZgyQD45x$IDIZXTLPrqOlw==, Int32 #=qRU2MepnR5CqKeB07D_yftQ==, Int32 #=q1nEEsJtf_mH8RL3usbGCfQ==)
在 #=qxboulPdRtGL88n3tiMjPVvBXgtEnnbPfn1S8U2VTvaQ=.#=qIw_6PbYTXJudM8SPXVkA0A==(Byte[] #=qZgyQD45x$IDIZXTLPrqOlw==)
在 #=qFUAIdRDUYKmU8XR1VP$pi$AbVlNgQnGxMrhB3HYP7U5We0E4UYG2AA8bJCLXxzoC.#=q5jKgkGVjZAs0H$15fR8KQQ==(String #=qgp0KuICtOmjNN5_TK4NKTn6f5d8x0LncBFFT7cm1Ljw=, Boolean #=qPZSlgaC4iryy04gCXBL1Zg==)
在 #=qWACtSyuCiwk0EL38bLsLjues5yw1izjxWT2Nc7lFFbbwromI4z0lGFCpNx1sHgAh.#=qa0OpUu0HLewtq7FmyidIzQ8sECeevP1$zV61Q6tXLhI=(String #=qJq122TC9aesEMVm__KLn0Q==, Int32 #=qxVkM6cHN653weGiN5O52IQ==, SecurityOptions #=qOor58qrcpx42YC6xj5JtnPzH2Y5clib4LvWV_Kctmmk=, Int32 #=qxRDWGKq$k5S_0UZaeFIoEQ==)
在 #=qWACtSyuCiwk0EL38bLsLjues5yw1izjxWT2Nc7lFFbbwromI4z0lGFCpNx1sHgAh.#=qXrYt1Joy2Qq_KtnsHaVMikp8DBC8eHTCyuTUeh7iQos=(String #=qJq122TC9aesEMVm__KLn0Q==, Int32 #=qxVkM6cHN653weGiN5O52IQ==)
— End of inner exception stack trace —
在 #=qWACtSyuCiwk0EL38bLsLjues5yw1izjxWT2Nc7lFFbbwromI4z0lGFCpNx1sHgAh.#=qXrYt1Joy2Qq_KtnsHaVMikp8DBC8eHTCyuTUeh7iQos=(String #=qJq122TC9aesEMVm__KLn0Q==, Int32 #=qxVkM6cHN653weGiN5O52IQ==)
在 #=qWACtSyuCiwk0EL38bLsLjues5yw1izjxWT2Nc7lFFbbwromI4z0lGFCpNx1sHgAh.#=qsGELDvbCjao1W1sEpQDtjHlpzOiGzJMKKAADbViWHrw=.#=qsz3eNyO_izlmoYyscsufvILTXn4qGEtVqjY353CCAM9x_oATOLXBt$ZTLjacJeGY()
— End of inner exception stack trace —
在 #=qWACtSyuCiwk0EL38bLsLjues5yw1izjxWT2Nc7lFFbbwromI4z0lGFCpNx1sHgAh.#=qzaElAy_FgRohwBmpziwMdQ6ZIETuyuuccrBSxJc6y_g=(String #=qJq122TC9aesEMVm__KLn0Q==, Int32 #=qxVkM6cHN653weGiN5O52IQ==)
在 #=qsdq3qIZoqiiPaW1Fx_7K9fy2h_axMxbf5DpRw$Fz$k0=.#=qYcc9In$cvhBRQMOgSonevQ==(Int32 #=q_hDUj5BD2bP6B6WEpMiDvA==)
在 #=qsdq3qIZoqiiPaW1Fx_7K9fy2h_axMxbf5DpRw$Fz$k0=.#=qdhdqKCHyleoC6FQ5GwRh4A==()
在 Aspose.Email.Pop3.Pop3Client.GetMessageCount(IConnection iConnection, Boolean closeTransaction)
在 Aspose.Email.Pop3.Pop3Client.GetMessageCount()

I am trying to get message from qq.com server,try several times can get message,but exception occurred frequently.
Please help

Pop3Client pop3Client = null;
pop3Client = new Pop3Client(“xxx@qq.com”, int.Parse(mPort), _email, mStrPass, _ssl == false ? SecurityOptions.Auto : SecurityOptions.SSLImplicit);
pop3Client.ConnectionTimeout = _receiveTimeout * 60 * 1000;
count = pop3Client.GetMessageCount();



—> AsposeException: 调用 SSPI 失败,请参见内部异常。
—> System.Security.Authentication.AuthenticationException: 调用 SSPI 失败,请参见内部异常。 —> System.ComponentModel.Win32Exception: 给函数提供的标志无效
— 内部异常堆栈跟踪的结尾 —
在 System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception)
在 System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
在 #=q8kys5Zf2j57TUKcEbGfY7Ip1R0XgGVj4kbNOBpmRWtA=.#=qfmKAvjCxnr9DSIYYIpJGDOTE9cFiV1wSwzI5c5hR8mY=(Object #=qHujO40Z0iE9rZcHLP3nK3w==)
在 #=q8kys5Zf2j57TUKcEbGfY7Ip1R0XgGVj4kbNOBpmRWtA=.#=qS7bvfpsLjOAyk4n8qSTX7w==()
在 #=q8kys5Zf2j57TUKcEbGfY7Ip1R0XgGVj4kbNOBpmRWtA=.Read(Byte[] #=qZgyQD45x$IDIZXTLPrqOlw==, Int32 #=qRU2MepnR5CqKeB07D_yftQ==, Int32 #=qp9mR6MZYVSbUZb20GMd1Bw==)
在 #=q7Y6ZWWQJ1ws2E7Pu8Bh2so62rQ9EWeaG9iinVORST$M=.Read(Byte[] #=qZgyQD45x$IDIZXTLPrqOlw==, Int32 #=qRU2MepnR5CqKeB07D_yftQ==, Int32 #=q1nEEsJtf_mH8RL3usbGCfQ==)
在 #=qxboulPdRtGL88n3tiMjPVvBXgtEnnbPfn1S8U2VTvaQ=.#=qIw_6PbYTXJudM8SPXVkA0A==(Byte[] #=qZgyQD45x$IDIZXTLPrqOlw==, Int32 #=qRU2MepnR5CqKeB07D_yftQ==, Int32 #=q1nEEsJtf_mH8RL3usbGCfQ==)
在 #=qxboulPdRtGL88n3tiMjPVvBXgtEnnbPfn1S8U2VTvaQ=.#=qIw_6PbYTXJudM8SPXVkA0A==(Byte[] #=qZgyQD45x$IDIZXTLPrqOlw==)
在 #=qFUAIdRDUYKmU8XR1VP$pi$AbVlNgQnGxMrhB3HYP7U5We0E4UYG2AA8bJCLXxzoC.#=q5jKgkGVjZAs0H$15fR8KQQ==(String #=qgp0KuICtOmjNN5_TK4NKTn6f5d8x0LncBFFT7cm1Ljw=, Boolean #=qPZSlgaC4iryy04gCXBL1Zg==)
在 #=qWACtSyuCiwk0EL38bLsLjues5yw1izjxWT2Nc7lFFbbwromI4z0lGFCpNx1sHgAh.#=qa0OpUu0HLewtq7FmyidIzQ8sECeevP1$zV61Q6tXLhI=(String #=qJq122TC9aesEMVm__KLn0Q==, Int32 #=qxVkM6cHN653weGiN5O52IQ==, SecurityOptions #=qOor58qrcpx42YC6xj5JtnPzH2Y5clib4LvWV_Kctmmk=, Int32 #=qxRDWGKq$k5S_0UZaeFIoEQ==)
在 #=qWACtSyuCiwk0EL38bLsLjues5yw1izjxWT2Nc7lFFbbwromI4z0lGFCpNx1sHgAh.#=qXrYt1Joy2Qq_KtnsHaVMikp8DBC8eHTCyuTUeh7iQos=(String #=qJq122TC9aesEMVm__KLn0Q==, Int32 #=qxVkM6cHN653weGiN5O52IQ==)
— End of inner exception stack trace —
在 #=qWACtSyuCiwk0EL38bLsLjues5yw1izjxWT2Nc7lFFbbwromI4z0lGFCpNx1sHgAh.#=qXrYt1Joy2Qq_KtnsHaVMikp8DBC8eHTCyuTUeh7iQos=(String #=qJq122TC9aesEMVm__KLn0Q==, Int32 #=qxVkM6cHN653weGiN5O52IQ==)
在 #=qWACtSyuCiwk0EL38bLsLjues5yw1izjxWT2Nc7lFFbbwromI4z0lGFCpNx1sHgAh.#=qsGELDvbCjao1W1sEpQDtjHlpzOiGzJMKKAADbViWHrw=.#=qsz3eNyO_izlmoYyscsufvILTXn4qGEtVqjY353CCAM9x_oATOLXBt$ZTLjacJeGY()
— End of inner exception stack trace —
在 #=qWACtSyuCiwk0EL38bLsLjues5yw1izjxWT2Nc7lFFbbwromI4z0lGFCpNx1sHgAh.#=qzaElAy_FgRohwBmpziwMdQ6ZIETuyuuccrBSxJc6y_g=(String #=qJq122TC9aesEMVm__KLn0Q==, Int32 #=qxVkM6cHN653weGiN5O52IQ==)
在 #=qsdq3qIZoqiiPaW1Fx_7K9fy2h_axMxbf5DpRw$Fz$k0=.#=qYcc9In$cvhBRQMOgSonevQ==(Int32 #=q_hDUj5BD2bP6B6WEpMiDvA==)
在 #=qsdq3qIZoqiiPaW1Fx_7K9fy2h_axMxbf5DpRw$Fz$k0=.#=qdhdqKCHyleoC6FQ5GwRh4A==()
在 Aspose.Email.Pop3.Pop3Client.GetMessageCount(IConnection iConnection, Boolean closeTransaction)
在 Aspose.Email.Pop3.Pop3Client.GetMessageCount()

Hi Chen,

Thank you for your interest in Aspose.

We tried connecting to a test gmail account with Pop3Client but could not observe the issue that you have reported. Can you please share your complete sample code and a test account that we can use to reproduce the issue at our end? We’ll use these details to investigate the issue further and assist you accordingly.