We use Aspose.Email v21.11 with .NET 6 to send emails.
When the code is executed in Windows, it works very well with all SMTP providers (Office 365, Sendgrid, amazon SES, …).
But when I run the code in Linux Ubuntu ( 22.04 LTS), the emails cannot be sent when we use Office 365 SMTP. It can be sent with other SMTP providers, like amazon SES.
The error message is: “Cannot determine the frame size or a corrupted frame was received.”
I made some research on the web. Most articles said that the problem comes from TLS.
I added the code below, but I still get the error.
client.SupportedEncryption = EncryptionProtocols.Tls12 | EncryptionProtocols.Tls11 | EncryptionProtocols.Tls; client.SetSupportedEncryptionUnsafe(EncryptionProtocols.Tls12);
Please, does anyone have any idea how to fix the problem?