Using LUA script to Email sends email body as text. how to change to HTML?

I am looping through Alarms with LUA and then keeping the information in a buffer variable and then calling action.email with the recipient and subject and the buffer in the body. The email sends but the Body is in plain text even though it is HTML format. How can i fix this?

When you pasted in the HTML in your original post above, did you miss any of it, or was that everything? I noticed that it did not start with an <HTML> tag. I was thinking that if the emailgtw is smart enough to detect HTML and set the message encoding properly, that tag might be important.