Verify mail server connection programmatically in ColdFusion

I'm using custom SMTP servers and would like to verify the connection when user enters his own server credentials. Exactly the same type of check as Adobe CF and Railo allow to do when adding mail