As soon as i see someone wanting to write an email package, I like to direct them to
. No need to write it yourself. You can even embed NeoMail in an existing web app. NeoMail is cooler than Yahoo!, more organized than Outlook, and very user-friendly. I urge you to take a look. It will simplify your entire project as well as appease your worries (tried-and-true security and features). That is, unless you plan to rival NeoMail! :-O