PHP Newsletter

Join now and receive weekly updates pertianing to the world of PHP.

Polls

What do you think about the new PHPMine Design?
Awesome
Not Bad
Sucks

PHP Gigs By City

PHP Jobs By Topic

Advertisements

php Mail() with html?

Asked 2008-05-22 20:56:31 by Dr.Wiggles

I want to put html in the message of the email.

mail("Dr.Wiggles@Wiggly.Org","WiggleWumper!","<html><body>Give me my wiggle wumpers!</body></html>");
woops,forgot,

but it's showing up as text

Anwered 2008-05-22 21:02:20 by Colanth

You can put any text you want in the body of the email, including HTML tags.

Anwered 2008-05-22 21:28:07 by molasses2

I can't tell since you didn't post your entire code, but it seems like the body isn't being properly interpreted as HTML because you never specify the document type.

I grabbed this off of an email in Outlook. I know the first line is considered a comment in a web browser, but maybe an email server reads it to determine encoding type. Not sure; haven't experimented. Hope it helps.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>

<TITLE>Message</TITLE>

<META content="MSHTML 6.00.2900.3314" name=GENERATOR></HEAD>
<BODY>

Questions and answers provided by the Yahoo Answers Community.