Forum Moderators: open

Message Too Old, No Replies

Rendering HTML in E-Mails

Several HTML capable services just not rending my HTML

         

JAB Creations

8:38 pm on Oct 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



First and formost no replies about why I shouldn't use HTML. I didn't learn what I already know by constantly letting people hassle me why I shouldn't do what I want to learn...

Ok now that the unpleasentness is behind...

I can't get HTML to be rendered in any email clients. I'm running Hivemail and I'm also playing around with Yahoo.

Unfortunitly my only success has been using IE to compose an email in Yahoo... it rendered the code in Yahoo AND Hivemail. However putting the same code in either service results in the code being passed on as plain text.

Is there some holy grail of a secret I am unaware of that anti-html email folks are hiding from me?

MozMan

10:23 pm on Oct 13, 2004 (gmt 0)

10+ Year Member



Yes, you can use HTML for emails, the only thing I would say is this: if you don't know for sure that all of your recipients clients will display HTML emails, then you should also do a plain text version. That way, the client can display whichever it prefers.

-Moz

tedster

10:41 pm on Oct 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



JAB, it sounds like the Content-Type may not be set to "text/html" when the services are sending the email out for you. Check the full header for one of the messages that is displaying as text-only and you may see Content-Type: text/plain rather than text/html.

If so, contact the service and have them sort this out for you.

JAB Creations

3:25 am on Oct 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well I'm testing this all out privatly... A contact form I'm testing out based on PHP to write the header with the text/html command or whatever...

Problem is that Hivemail my web based mail client is *NOT* recognizing the email sent from the contact form as text/html, just plain text.

AHHHHHHHHHHHHHHHHHHHHHHHHHHH!
I figured it out! I might as well have won the lotto kind of excited!

It was putting the header string AFTER the msg string...it seems to have been the placement of how the strings are printed? Anyway it works! Extreme frustration plus undieing ambition = raving (eventual) happiness!


<?
}
if (isset($_POST["submit"]) and ($checked) ) {
$msg = "Text Here 1 2 3\n";
$msg .= "<h2>Name</h2><h5>:</h5> ".$_POST["name"]."\n";
$msg .= "<h2>Phone</h2><h5>:</h5> ".$_POST["phone"]."\n";
$msg .= "<h2>E-Mail</h2><h5>:</h5> ".$_POST["email"]."\n";
$msg .= "<h2>Comments</h2><h5>:</h5> ".$_POST["comments"]."\n";
$msg .= "<h2>Reply By</h2><h5>:</h5> ".$_POST["preference"]."\n";
$msg .= "Street=".$_POST["street"]."\n";
$msg .= "City=".$_POST["city"]."\n";
$msg .= "Florida=".$_POST["state"]."\n";
$msg .= "Zip Code=".$_POST["zip"]."\n";
$msg .= "Referred By=".$_POST["referral"]."\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
mail("noone@nowhere.net","Business Inquiry", $msg, $headers);
echo "e-mail has been sent to: noone@nowhere.net<br>\n";
echo nl2br($msg) . "<br>\n";
?>
</body>
</html><?
}
?>