title: Unable to send mail to local SMTP server with TLS
body: <p>So we have a local exchange server that we use as a SMTP server for our internal servers. I'm trying to fix so it works with TLS but right now it's not.</p>
  
  <p>I have a wildcard certificate assigned to both SMTP and the IIS roles. But When I try to use <code>send-mailmessage</code> through PowerShell for example I am getting.</p>
  
  <pre><code>Send-MailMessage -SmtpServer mail.domain.com -UseSsl -port 465 -From fromaddress 
  -To tomailaddress -Subject test -BodyAsHtml test -Encoding ([System.Text.Encoding]::UTF8)
  </code></pre>
  
  <p>The remote certificate is invalid according to the validation procedure.</p>
  
  <p>The certificate used is valid for me when I go to the IIS site (or any other site that uses the same certificate).</p>
  
  <p>So what am I doing wrong? Or how can I troubleshoot this.</p>