If you have Smartermail installed on your dedicated server, skip to point 3.
1. Make sure that the Simple Mail Transfer Protocol service is enabled in Administrative Tools/Services
2. In your code reference the mail server as localhost. This will send mail through the default SMTP service
3. If Smartermail is enabled and running on your server, the default SMTP service needs be disabled. To use Smartermail to relay mail through your server go into the Smartermail web interface Security> SMTP Authentication Bypass and add your server's ip addresses to it.
4. Restart Smartermail SMTP service