Adding a html file as attachment makes no sense.
When creating a mail you can click in the editor on "Source". There you can paste your code.
When this does not give the expected result, please provide us with more information. Without it we can't see what's wrong.