added encoding and header support to mail()