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?

Recommended Answers

All 3 Replies

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.