Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Sending Mail: Choice between sending receipt, or HTML formatting

I want to send both!

2:49 am on Jan 6, 2007 (gmt 0)

Preferred Member

10+ Year Member

joined:Aug 12, 2005
votes: 0


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?


3:34 pm on Jan 6, 2007 (gmt 0)

Preferred Member

10+ Year Member

joined:Aug 6, 2005
votes: 0

"\r\n" is correct. I don't know much about email headers, but maybe Disposition-Notification-To: name<email> has to come before Content-type:text/html;charset=utf-8?

If that doesn't work, send yourself an HTML-formatted email that requests a receipt and then look at the headers.


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members