Probably this is way too old, but since I have an easy fix (I guess) I will give it a shot:
If you only want to try the code (mail function) and see if the email is actually sent, in your dev environment, you can try to accomplish that with this small tool: http://www.toolheap.com/test-mail-server-tool/
I used it several times in the past when I had no proper smtp mail server configuration available and I had to test in a few seconds that my code was behaving properly.
I hope it helps.