If you're looking to create your own I would suggest using the
SwiftMailer library. You will need to write your own form processing script, CAPTCHA test etc but the library will handle any issues with email header injection for you. Very easy to use too