Well,
If i were you i would use the mail() function to send the outgoing e-mail and use the IMAP functions to retreive the e-mail (i know it says IMAP, but it also supports POP3 and NNTP as well).
Take a look at the section 'IMAP functions' in the 'Function reference' part of the manual:
www.php.net/manual/en/