I'm using PHP's mail function to send out a message via email.
I would like for this email message to send a receipt when read as well as send an HTML formatted email. Both aspects are important to me.
I know this is a product of the mail header. This is the format I currently have:
mail(to, subject, body, "From: name <email>\r\nDisposition-Notification-To: name<email>\r\nContent-type:text/html;charset=utf-8");
This prompts the email program to send a reciept, but the email message is not in the HTML format, and even contains "Content-type:text/html;charset=utf-8" at the top of the body.
If I switch the order to this format:
mail(to, subject, body, "From: name <email>\r\nContent-type:text/html;charset=utf-8\r\nDisposition-Notification-To: name<email>");
This sends the email with HTML formatting but does not prompt the sending of the receipt. I also get "Disposition-Notification-To: name<email>" at the top of the email message.
This tells me there is a problem in the transition between the headers, which currently is "\r\n".
What am I doing wrong?