In my website I send a welcome email to new members in html format. To do this I use the mail() function within a function I have created myself (see below). This fuction has been tested with all major mail programs and works just fine, but a particular user came back to me saying that he's received a blank email (his email address ends in @free.fr). I've sent the email again, but the same problem occured. Does anyone know what the cause could be?

Here's the function I have created to send html emails (arguments are self-explanatory):

Thanks for getting back to me. Please see below the function I use to send emails. Another problem I get is that the email is often marked as SPAM, no matter how simple the $html_msg is. So I believe it doesn't depend on the content of the email.
Here's the function:

I have also tried some small variations of it; for instance I've added the Subject header and I have also tried to replace \n with \r\n (which in turn gives other problem), but to no avail. It really bugs me, because many new members of my website cannot basically verify their email address!

try sending that mail (using same code ) to yourself... see if u get an empty mail.

and sending a text/plain email message, see if the Client is good enough.. to atleast understand that...
Actually its always good to send 2 formats of email.. 1 HTML one and other text/plain...
use phpmailer quite useful.