Base solution for your next web application
Open Closed

Sending Emails Error #12019


User avatar
0
eftimevalerian created

I've upgraded my project - aspnet core MVC & jQuerry from 13.0.0 to 13.2.0 and I'm getting an error when I try to send emails. Here is the error:

An error was encountered while sending an email. An error occurred while attempting to establish an SSL or TLS connection. The server's SSL certificate could not be validated for the following reasons: • The server certificate has the following errors: • The revocation function was unable to check revocation for the certificate. • The revocation function was unable to check revocation because the revocation server was offline. • An intermediate certificate has the following errors: • The revocation function was unable to check revocation for the certificate. • The revocation function was unable to check revocation because the revocation server was offline. • The root certificate has the following errors: • A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.


2 Answer(s)
  • User Avatar
    1
    m.aliozkaya created
    Support Team

    Hi @eftimevalerian,

    You should configure the SSL certificate on your server based on the error.

    We recommend installing the SSL certificate correctly. But if you want to find a quick solution without sacrificing security.

    • Open MailKitSmtpBuilder.cs https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Core/Net/Emailing/AbpZeroTemplateMailKitSmtpBuilder.cs

    • Change line 31 to

    client.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;
    
  • User Avatar
    0
    eftimevalerian created

    Thank you, it worked.