If it is what you want, send the php/html page as it displays in the browser in a html format email. The above scripts should work.
If you have some database problems, it should not be due to the mail scripts.
1) First of all, you need to see if your php/html page display right in the browser.
2) And then these codes just read the html page contents and send it out as html format email. It will be the same as you see in the browser. It is no different than to read a pure html document and send it out.
3) you need to use the full web address in that page for the links, images etc., not relative address.
Hope that helps.