fixing multipart email bug in email script