Fixed WordPress plugin headers.
Moved core code to separate file to enable PHP version checking in mail plugin script.