March 1st, 2013, 07:32 AM
Php mail ( spits out html tags )
Some clients are reporting that they see all the html code from my php mail. I modified the headers so it should work but it doesn't.
Any idea what i can add so everyone see's html.
One reported html output came from a @live.be account
$subject = "Bedankt voor uw inschrijving";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=utf-8 \r\n";
$headers .= "From: email@example.com\r\n";
$headers .= "Reply-To: firstname.lastname@example.org\r\n";
$headers .= "X-Mailer: PHP/".phpversion()."\r\n";
$body = '
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
March 1st, 2013, 07:40 AM
They probably have HTML turned off on their mail readers. You cannot control that. The solution is to create a multi part message that has both HTML and plain text or only send plain text. To make life easy on yourself you should use a mailer package like PHPMailer.
Comments on this post
There are 10 kinds of people in the world. Those that understand binary and those that don't.
March 1st, 2013, 07:41 AM
So it is possible to check if HTML is turned off? and if it is just output plain text version? if yes could you tell me how please! thank you!
Originally Posted by gw1500se
March 1st, 2013, 08:03 AM
You can send a multipart message consisting of both rich and plain text versions of the message.
The first google result for the terms is this, but I don't know how accurate it is.
HEY! YOU! Read the New User Guide and Forum Rules
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question
or you're a Help Vampire.
Trying to argue intelligently? Please read this.