Sending email with attachment by using sendgrid in asp.net webforms application. In local it is working fine. but after deploy it on production iis getting below exception.
System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
The code is
var msg = MailHelper.CreateSingleEmailToMultipleRecipients(from, toList, subject, plainTextContent, htmlContent, true);
var response = await client.SendEmailAsync(msg).ConfigureAwait(false);
How to solve this?