Forum Moderators: coopster

Message Too Old, No Replies

Parse HTML in php form

         

music_man

10:33 pm on Jan 6, 2006 (gmt 0)

10+ Year Member



Hi

I am wanting to be able to send an html page to people on a mailing list.

I have set it up so it sends $mailing_template which sends an html page. Only, when it reaches the inbox it shows as straight html (un parsed) and not as the page.

How can I set it to send it as HTML and not straight HTML code please?

Using php.

Thanks

wsmeyer

11:18 pm on Jan 6, 2006 (gmt 0)

10+ Year Member



It's probably a problem with the email header not being set to html.

I sent an html email a while back and figured out how to do it by pulling one out of my junk mail and disecting it. If you do that you'll see the headers to use for multi-part mime and a character string that seperates the formats. It will basically look like this:

-header-

-character string-

-text formatted portion-

-character string-

-html formatted portion-

-character string-

William.

music_man

11:21 pm on Jan 6, 2006 (gmt 0)

10+ Year Member



Hi

So how do I send it as multi-part MIME please?

Cheers

chriswragg

12:06 pm on Jan 7, 2006 (gmt 0)

10+ Year Member



Check out the php manual for the mail function [uk.php.net], and look at example 4. The headers you need to add are there.

AjiNIMC

3:11 am on Jan 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Also check the mail box whether html is disabled, sometime the setting is made for plan text only.

vevs

6:23 pm on Jan 8, 2006 (gmt 0)

10+ Year Member



make sure that you use the correct mail header

$mailheader = "From: $email\r\n";
$mailheader .= "Reply-To: $email\r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";

mail($to, $subject, $MESSAGE_BODY, $mailheader) or die ("Failure");

Hope this helps
Vevs

[edited by: coopster at 8:13 pm (utc) on Jan. 8, 2006]
[edit reason] no personal urls please TOS [webmasterworld.com] [/edit]