php file writing & mailing completed