title: How to check, by PHP, if my script is connecting to SMTP server
body: <p>Simply what the title says.
  Want to know how to check if the connection is working and if not, what is the error.
  Btw the SMTP server is exchange 2007.</p>