title: "stream_socket_enable_crypto(): Peer certificate CN=`gains.nanosupercloud.com' did not match expected CN=`smtp.sendgrid.net'" in shared hosting
body: <p>I'm working in mail in laravel. I've following configuration.</p>
  
  <pre><code>MAIL_DRIVER=smtp
  MAIL_HOST=smtp.sendgrid.net
  MAIL_PORT=587
  MAIL_USERNAME=********
  MAIL_PASSWORD=########
  MAIL_ENCRYPTION=tls
  </code></pre>
  
  <p>I've already tried this one but not working</p>
  
  <p><a href="https://stackoverflow.com/questions/41554028/stream-socket-enable-crypto-peer-certificate-cn-cs723-mojohost-com-did-not">stream_socket_enable_crypto(): Peer certificate CN=`cs723.mojohost.com&#39; did not match expected CN=`smtp.sendgrid.net&#39;</a></p>
  
  <p>And many more similar question but still i don't get the solution. I've following error:</p>
  
  <blockquote>
    <p>ErrorException (E_WARNING)
    stream_socket_enable_crypto(): Peer certificate CN=<code>gains.nanosupercloud.com' did not match expected CN=</code>smtp.sendgrid.net'</p>
  </blockquote>
  
  <p>I don't know what i'm doing wrong. Here is the code used for email sending.</p>
  
  <pre><code>public function toMail($notifiable)
  {
      return (new MailMessage)
                  -&gt;from(\Config::get('values.app_email'),\Config::get('values.app_name'))
                  -&gt;subject('Successfully approved your Company')
                  -&gt;greeting(sprintf('Hello %s', $this-&gt;user-&gt;name))
                  -&gt;line('Your company has been approved successfully. Now, it will be visible to our website');
  }
  </code></pre>
  
  <p>Any kind of suggestions are appreciated.</p>
  
  <p><strong>Note: Everything works perfectly in local server(ubantu 16.04)</strong></p>