title: SMTP error with sending Emails on moodle 3.0
body: <p>I have the same Email configuration (in messages output) for 2 Moodle installation on the same server:</p>
  
  <ol>
  <li>version 2.9.1+</li>
  <li>version 3.0</li>
  </ol>
  
  <p>I am using Exchange server as SMTP host server.</p>
  
  <p>On the 2.9 the emails are working fine but on the 3.0 I am having an error:</p>
  
  <pre><code>    250-SIZE 37748736
                                    250-PIPELINING
                                    250-DSN
                                    250-ENHANCEDSTATUSCODES
                                    250-STARTTLS
                                    250-X-ANONYMOUSTLS
                                    250-AUTH NTLM LOGIN
                                    250-X-EXPS GSSAPI NTLM
                                    250-8BITMIME
                                    250-BINARYMIME
                                    250-CHUNKING
                                    250 XRDST
   2015-12-22 09:47:25    CLIENT -&gt; SERVER: STARTTLS
   2015-12-22 09:47:25    SMTP -&gt; get_lines(): $data is ""
   2015-12-22 09:47:25    SMTP -&gt; get_lines(): $str is  "220 2.0.0 SMTP server     ready                         
   2015-12-22 09:47:25    SERVER -&gt; CLIENT: 220 2.0.0 SMTP server ready
   2015-12-22 09:47:26    SMTP Error: Could not connect to SMTP host.
   2015-12-22 09:47:26    CLIENT -&gt; SERVER: QUIT
   2015-12-22 09:47:26    SMTP -&gt; get_lines(): $data is ""
   2015-12-22 09:47:26    SMTP -&gt; get_lines(): $str is  ""
   2015-12-22 09:47:26    SERVER -&gt; CLIENT:
   2015-12-22 09:47:26    SMTP ERROR: QUIT command failed:
   2015-12-22 09:47:26    Connection: closed
   2015-12-22 09:47:26    SMTP connect() failed.     https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
  </code></pre>
  
  <p>Note that I am using the exact same configuration except that in 2.9 you don't have the option to choose between (LOGIN, PLAIN, NTLM) but it is exists in 3.0 and I have tried them all.</p>
  
  <p>Does anybody has a clue what is going on? is it a bug or ma I missing anything, it has been 2 days and it is becoming frustrating.</p>