...

View Full Version : outputting emails in html



sherman
03-11-2003, 03:37 PM
I am currently running a mailing list I found off line which is no longer supported. Its simple but the best one Ive ever found, the only thing it lacks is to send message out in HTML format. Is there a funuction I could add to have this happen? what could I do?

firepages
03-11-2003, 05:29 PM
making an email HTML is basically a case of adding the right headers..

so



<?
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
$headers .= "Content-Transfer-Encoding: 8bit\n";

$to='someone@blah.com";
$subject='hello in html';
$msg='<html><body><h3>hello</h3></body></html>';

mail($to,$subject,$msg,$headers);
?>


... is the simplest example , so its probably a case of finding out where in your script the mail headers are set and adding the appropriate extra ones as above.

x_goose_x
03-11-2003, 06:31 PM
the line:

$to='someone@blah.com";

should have a single quotation at the end:

$to='someone@blah.com';

firepages
03-11-2003, 06:35 PM
DOH :)

keep it quiet but I think that Spookster chappie comes in and edits my posts sometimes :eek:

LaundroMat
03-12-2003, 09:12 PM
Why do I get this error?

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING
in this line:

$headers = "MIME-Version: 1.0\n";

Nightfire
03-12-2003, 11:24 PM
You do it without the _ lines in?

LaundroMat
03-13-2003, 08:05 AM
Originally posted by Nightfire
You do it without the _ lines in?

Heh. The underscores weren't in the original code; it must've been added by copy-pasting...

Anyway, I rechecked, never mind the underscores (I'll edit them). Anyone else see what could be the problem?

firepages
03-13-2003, 09:21 AM
there are no errors in that line , check the line immediately preceeding it ?

LaundroMat
03-14-2003, 01:21 PM
There's no line preceding it... I'll read up on mail() and possible settings and such..Thanks already :)

LaundroMat
03-14-2003, 01:21 PM
There's no line preceding it... I'll read up on mail() and possible settings and such..Thanks already :)

sherman
03-15-2003, 02:25 PM
oh man now i am confused, if anyone wants to email me I will send them the script and maybe you would see where that function should go. Thanks for the help!

x_goose_x
03-19-2003, 08:05 PM
A simple tutorial.
http://www.phphideout.com/articleview.php/10
why not post your script?

sherman
03-19-2003, 09:01 PM
good idea, attached is the script!

Nightfire
03-19-2003, 10:06 PM
Well depending on which email(s) it is you're wanting to send in html, find


$headers = "From: \"$list_name\" <$owner_email>\r\nReply-To: $owner_email\r\nX-Mailer: PHPMailList V$version http://php.warpedweb.net/\r\n";
and change it to

$headers = "From: \"$list_name\" <$owner_email>\r\nReply-To: $owner_email\r\nX-Mailer: PHPMailList V$version http://php.warpedweb.net/\r\nMIME-Version: 1.0\r\nContent-Type: text/html; charset=iso-8859-1\r\nContent-Transfer-Encoding: 8bit\r\n";

sherman
03-25-2003, 04:00 PM
I could not find that exact statement in the maillist.php, is it possible its called something else?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum