added test mime function and fixed carriage return issues
added mime functionality