I was trying to tweak some html headers due to change in content type and facing a weird issue
When I execute the below code it doesn't gets email delivered at all

$htmlheader = "From: $emailad\r\nContent-Type: text/html\r\nContent-Transfer-Encoding: 8bit\r\n";

But when I add extra slash ( \ ) and double quotes (") to the end, it does prints the double quotes (") to start of the email its sending, Imgur snap

$htmlheader = "From: $emailad\r\nContent-Type: text/html\r\nContent-Transfer-Encoding: 8bit\r\n\" ";

I don't know whats going wrong. Any help?

1 Year
Discussion Span
Last Post by Atli

Im not sure why you are doing this, but "\" is an escape delimiter in PHP - so if you type \" it will treat the " as a string literal. If you are NOT intending this, then your string is invalid, as you would have 3 quotes in your string making it an unterminated constant...

Hope that helps :-/


@ryantroop Thanks for that. Some contents are delivered with the first code and all contents are delivered with second code. Any pointer here?


Can you post the entire email source, including all the headers and the data?
It's kind of hard to see the problem judging just by the additional headers.

On a side-note. The PHP mail() function is generally not a good choice for anything more complex then simple text emails. I'd recommend using something more powerful, like Swift Mailer or PHPMailer. Those will take care of all this low-level stuff for you.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.