[Mono-dev] sending smtp email under SSL

idepaula nachodepaula at gmail.com
Fri Aug 22 15:49:39 EDT 2008


Hi,

I'm facing the same issue, it seems like this issue has not been addressed
yet :(

Did anyone find a workaround for alternative solution for sending emails
through gmail?

Thanks in advance,
Ignacio.


gedw99 wrote:
> 
> Hey,
>  
> i am trying to send an email using a gmail account.
> According to the docs, Network Credentials does not support SSL.
> http://www.go-mono.com/docs/index.aspx?link=T%3ASystem.Net.NetworkCredential%2F*
>  
> I am using the latest mono 1.2, and XPS2 !
> Is there an alternative way to send email under SSL ????
>  
> Code and error below::::
>  
>  
> SmtpClient mailClient = new SmtpClient();
> mailClient.EnableSsl = true;
> mailClient.DeliveryMethod = SmtpDeliveryMethod.Network;
> mailClient.Host = "smtp.gmail.com";
> mailClient.Port = 587;
> mailClient.Credentials = new NetworkCredential(Config.GMAIL_UserName,
> Config.GMAIL_PassWord);
> mailClient.Send(this._from, this._to, this._subject, this._body);
>  
> THis fails with:
>  
> Server Error in '/' Application
> 
> 
> SSL authentication error: RemoteCertificateChainErrors
> Description: Error processing request.
> Error Message: HTTP 500. System.InvalidOperationException: SSL
> authentication error: RemoteCertificateChainErrors 
> Stack Trace: 
> 
> 
> 
> 
> System.InvalidOperationException: SSL authentication error:
> RemoteCertificateChainErrors  at
> System.Net.Mail.SmtpClient.<SmtpClient>c__38 (System.Object sender,
> System.Security.Cryptography.X509Certificates.X509Certificate certificate,
> System.Security.Cryptography.X509Certificates.X509Chain chain,
> SslPolicyErrors sslPolicyErrors) [0x00000]   at
> System.Net.Security.SslStream+<>c__CompilerGenerated13.<BeginAuthenticateAsClient>c__44
> (System.Security.Cryptography.X509Certificates.X509Certificate cert,
> System.Int32[] certErrors) [0x00000]   at
> Mono.Security.Protocol.Tls.SslClientStream.OnRemoteCertificateValidation
> (System.Security.Cryptography.X509Certificates.X509Certificate
> certificate, System.Int32[] errors) [0x00000]   at
> Mono.Security.Protocol.Tls.SslStreamBase.RaiseRemoteCertificateValidation
> (System.Security.Cryptography.X509Certificates.X509Certificate
> certificate, System.Int32[] errors) [0x00000]   at
> Mono.Security.Protocol.Tls.SslClientStream.RaiseServerCertificateValidation
> (System.Security.Cryptography.X509Certificates.X509Certificate
> certificate, System.Int32[] certificateErrors) [0x00000]   at
> Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.validateCertificates
> (Mono.Security.X509.X509CertificateCollection certificates) [0x00000]   at
> Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.ProcessAsTls1
> () [0x00000]   at
> Mono.Security.Protocol.Tls.Handshake.HandshakeMessage.Process () [0x00000]  
> at (wrapper remoting-invoke-with-check)
> Mono.Security.Protocol.Tls.Handshake.HandshakeMessage:Process ()  at
> Mono.Security.Protocol.Tls.ClientRecordProtocol.ProcessHandshakeMessage
> (Mono.Security.Protocol.Tls.TlsStream handMsg) [0x00000]   at
> Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback
> (IAsyncResult asyncResult) [0x00000] 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 
> 

-- 
View this message in context: http://www.nabble.com/sending-smtp-email-under-SSL-tp14518813p19113075.html
Sent from the Mono - Dev mailing list archive at Nabble.com.



More information about the Mono-devel-list mailing list