Can I get FTP access and a url to the page you are testing to debug? I don't see the problem with this code.
You might try removing the ip address and port in the mail settings:
$WA_MailObject = WA_SecurityAssist_Definition("127.0.0.1","25","","","","");
Those are usually defaulted to the correct value by your host and the defaults should be used if they aren't overwritten like:
$WA_MailObject = WA_SecurityAssist_Definition("","","","","","");
To debug further I'd have to have access to the code and web site to reproduce.