我正在使用 Mandrill API 发送电子邮件。
我正在发送一个发送电子邮件的webrequest
toSend
方法。它在我当地运行良好。当我将代码移到生产服务器时,出现以下错误:
The underlying connection was closed: An unexpected error occurred on a receive.
内部异常是:
System.EntryPointNotFoundException: Unable to find an entry point named 'EnumerateSecurityPackagesW' in DLL 'security.dll'.
at System.Net.UnsafeNclNativeMethods.SafeNetHandles_SECURITY.EnumerateSecurityPackagesW(Int32& pkgnum, SafeFreeContextBuffer_SECURITY& handle)
at System.Net.SafeFreeContextBuffer.EnumeratePackages(SecurDll Dll, Int32& pkgnum, SafeFreeContextBuffer& pkgArray)
at System.Net.SSPIWrapper.EnumerateSecurityPackages(SSPIInterface SecModule)
at System.Net.SSPIWrapper.GetVerifyPackageInfo(SSPIInterface secModule, String packageName, Boolean throwIfMissing)
at System.Net.Security.SecureChannel..ctor(String hostname, Boolean serverMode, SchProtocols protocolFlags, X509Certificate serverCertificate, X509CertificateCollection clientCertificates, Boolean remoteCertRequired, Boolean checkCertName, Boolean checkCertRevocationStatus, EncryptionPolicy encryptionPolicy, LocalCertSelectionCallback certSelectionDelegate)
at System.Net.Security.SslState.ValidateCreateContext(Boolean isServer, String targetHost, SslProtocols enabledSslProtocols, X509Certificate serverCertificate, X509CertificateCollection clientCertificates, Boolean remoteCertRequired, Boolean checkCertRevocationStatus, Boolean checkCertName)
at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.ConnectStream.WriteHeaders(Boolean async)
我的生产服务器环境是:
OS: Windows Server 2008 R2 Standard
Hosting Environment: IIS7
请帮助我解决问题,因为这对我来说是停工。