Damn - first time i've been called Sir for a long time!! I think I kinda like that (Yeh, yeh, I know he wasn't speaking JUST to me! 🙂 )
Anyhow - HTML mail sending seems to be a common subject for lots of people. I have no doubt that there are hundreds and hundreds of classes out there already for doing this kind of somple mailing (I know I am responsible for a couple of them).
Anyhow - I am not in the habit of re-writing peoples code for them, since you learn a hell of a lot more by trying it yourself - but to point you in the right direction with doing this with the "mail" function -
1, everything in this type of mail should go into the "header" argument (4th argument). No body should exist, and the content boundaries etc all make up part of the header, i.e. this line should NOT be $message.="Hello! Here's that logo you requested!"; //Am I correct? , but SHOULD be $header.="Hello! Here's that logo you requested!"; //Am I correct?
Also - at the end of a MIME part header you need \r\n\r\n before the MIME parts content
2, NEW LINES NEW LINES NEW LINES. You don't have ANYTHING to split up your headers - so they are all going to be on the same line. Attach "\r\n" to the end of each line, i.e. $header.="Date: Sun, 29 Sept 2002 06:18:47 -0400" . "\r\n";
3, add a couple of more lines to your header. One of them should be a From field (go read up lots on headers for emails - there are loads of platform/email client specific ones which you can exploit or make use of depending on your requirements)
4, get rid of a couple of lines from your header. Do you need a Date field? Since you are using sendmail (through the mail func) then this is not really required unless you want to post/pre date the message which is quite bad practice. Also, get rid of the Message-ID header. This is not required - you will just confuse the SMTP server if it's gets duplicate message id's. Just let the server (or sendmail) generate one for you.
Ok - so that should get you going in the right direction. I have founf "mail" to be a poor way of doing this though and have finally got round to writing myself a decent class that interacts directly with the SMTP server (not that difficult - and gives you loads more control over your mail, such as Reply-to headers - yes I knwo this is bad, but is required sometimes - etc). Of course this has drawbacks (new connectino for every mail), but a suggestion to extend this would be adding some kind of cron task to periodically send mails.
Anyhow - hope this helps....