CMS email issues: An error occurred while attempting to establish an SSL or TLS connection
We have recently been migrating from v8 to v10 and while most troubled situations have been resolved a couple issues remain. One of the issues is the SMTP Settings, or to be more frank I'm not even sure if that's the issue.
In v8 we had email notifications functioning properly for a little over a year. Ex: user makes changes to page, selects "send to publish", admins get email from CMS that a page is ready to publish, etc. Forms workflows also worked great utilizing the email function.
In v10 we simply can't get the same email function to work.
in appsettings.json the configuration is set as follows
Check passed: SMTP settings are configured correctly and the service is operating as expected.
When a user selects "send to publish" the following error shows up in the log (3 times in a row):
MailKit.Security.SslHandshakeException: 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.
• The root 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.
---> System.Security.Authentication.AuthenticationException: The remote certificate was rejected by the provided RemoteCertificateValidationCallback.
at System.Net.Security.SslStream.SendAuthResetSignal(ProtocolToken message, ExceptionDispatchInfo exception)
at System.Net.Security.SslStream.CompleteHandshake(SslAuthenticationOptions sslAuthenticationOptions)
at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)
at MailKit.Net.Smtp.SmtpClient.ConnectAsync(String host, Int32 port, SecureSocketOptions options, Boolean doAsync, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at MailKit.Net.Smtp.SmtpClient.ConnectAsync(String host, Int32 port, SecureSocketOptions options, Boolean doAsync, CancellationToken cancellationToken)
at Umbraco.Cms.Infrastructure.Mail.EmailSender.SendAsyncInternal(EmailMessage message, String emailType, Boolean enableNotification)
at Umbraco.Cms.Infrastructure.Mail.EmailSender.SendAsync(EmailMessage message, String emailType)
at Umbraco.Cms.Core.Services.NotificationService.<>c__DisplayClass30_0.<Process>b__0(Object state)
These are the same settings as we had used in the older versions in web.config which worked fine, however setup in appsettings.json in v10 we can't get it to work... Switching back to v8 once again resumes the email functionality just fine.
If anyone has insight on this I would greatly appreciate it as I'm pretty much out of ideas at this point.
Similar, here's the v8 settings, only difference is we didn't specify the port and used IP for network host. Using IP for "Host" in v10 settings clears health check but still fails to send email
v8 settings, all emails send just fine with these:
Seems a bit odd that you need to set securesocketoptions to none since port 25 does not use any kind of secure socket, I have never had to use it when testing using a local SMTP on port 25
CMS email issues: An error occurred while attempting to establish an SSL or TLS connection
We have recently been migrating from v8 to v10 and while most troubled situations have been resolved a couple issues remain. One of the issues is the SMTP Settings, or to be more frank I'm not even sure if that's the issue.
In v8 we had email notifications functioning properly for a little over a year. Ex: user makes changes to page, selects "send to publish", admins get email from CMS that a page is ready to publish, etc. Forms workflows also worked great utilizing the email function.
In v10 we simply can't get the same email function to work.
in appsettings.json the configuration is set as follows
Also here:
When running Health Check all seems well:
When a user selects "send to publish" the following error shows up in the log (3 times in a row):
These are the same settings as we had used in the older versions in web.config which worked fine, however setup in appsettings.json in v10 we can't get it to work... Switching back to v8 once again resumes the email functionality just fine.
If anyone has insight on this I would greatly appreciate it as I'm pretty much out of ideas at this point.
What email settings do you have for v8? Are they identical to the ones you show above?
Similar, here's the v8 settings, only difference is we didn't specify the port and used IP for network host. Using IP for "Host" in v10 settings clears health check but still fails to send email
v8 settings, all emails send just fine with these:
in web.config:
in umbracoSettings.config
Accidentally marked this as solution... can't unmark it, still having the issue.
what happens in 10 if you set the port to 25?
So that actually worked but with a caveat.
The final appsetting.json looks like this:
Port 25 didn't work before without
"SecureSocketOptions": "None"
The solution was hunted down eventually thanks to this: https://codeshare.co.uk/blog/how-to-send-emails-in-umbraco-9-using-iemailsender/
Seems a bit odd that you need to set securesocketoptions to none since port 25 does not use any kind of secure socket, I have never had to use it when testing using a local SMTP on port 25
is working on a reply...