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.
Since this is most likely related to your other question: Configure mail server to work with PHP, I'll put the answer here too:
You're using the PEAR Mail package. The send() method returns TRUE on success, or a PEAR_Error object otherwise, which will contain details of the failure. Most likely you'd want $PEAR_Error::message. Full details here: Configure mail server to work with PHP