I have the same problem as reported by others in this thread: I can send a test email to my gmail account successfully but when I attempt to do it from a php file using mail() it fails.
The "Send Test" must be doing something different than plain old "mail()". "Send Test" works but mail() does not.
The bottom line for me is that using php mail() does not work.