I'm trying to send user a password reset link but when it comes to the Smtp.send stage, I got error saying that The remote certificate is invalid according to the validation procedure.
I'm not using Gmail to send this, I'm using our own domain mail server. Will it be issue for this matter ?
this is the sample of the code.
var smtp = new SmtpClient {
Host = "mail.sample.com",
Port = 587,
EnableSsl = true,
DeliveryMethod = SmtpDeliveryMethod.Network,
UseDefaultCredentials = false,
Credentials = new NetworkCredential(fromEmail.Address, fromEmailPassword)
};
using(var message = new MailMessage(fromEmail, toEmail) {
Subject = subject,
Body = body,
IsBodyHtml = true
})
smtp.Send(message);