When you say it fails, is any exception thrown/error reported
There doesnt look to be anything obviously wrong with the code itself for sending mail to an smtp server. Sometimes things like authentication cause issues which prevent mail being sent but this normally manifests itself with some error condition.
|