Hey,
First off what OS are you using ??? win32/unix variant ???
If you using win32 you have to set the SMTP option (in your php.ini) to your smtp server name or address (any smtp server you have access to and that you can relay mail through). You can also set the default sendmail_from option (only used on win32).
If you on a unix variant you can set the sendmail_path option (in your php.ini) to the path to sendmail (run 'which sendmail' from a shell to get the path) and all should work.
If your not sending all of the required headers that could also be the problem. mail() requires atleast a to 'To:' header.
Perhaps you could submit your code so others can take a look and see if there's something missing...
P.S. the IMAP server type is not a server which can be used to send e-mail. It is a server much like the Post Office Protocol (POP) server, only more advanced.