Nowhere in this thread was such a subroutine posted, so maybe you wanted to reply to a different thread?
If the "email subroutine" is in some code that you are not showing us, consider posting the relevant parts of the code. Also tell us how the code fails to do what you need, and also show us what you already tried and also how that failed for you.