Wrox Programmer Forums
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 24th, 2005, 06:09 AM
Registered User
 
Join Date: Feb 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default HTML email

Hi,
   for some reason I cannot get the emails to output html emails. It will work if I set $message to say "<IMG height=110 alt=Google src=\"http://www.google.co.uk/intl/en_uk/images/logo.gif\" width=276> " in the same file but if I make $message = $html it does not work. I have echoed it out and the value in $html is the exact html code I want to go to the emails. All that happens is that it displays the html code in the email not the google logo as it should. What am I doing wrong?

Regards

Rob

<?

$radio = $_REQUEST['group1'];
$html = $_REQUEST['pageContent'];

// connect to the mysql database server.
$linkid = mysql_connect (,,)or die(mysql_error());
//select the database
mysql_select_db("",$linkid) or die(mysql_error());


//queries******************************************* ************************************************** *********
$massmail="SELECT email FROM massmailtest WHERE email != ''";
$result=mysql_query($massmail);
while($row = mysql_fetch_array($result, MYSQL_NUM)){
    $name =$row['0'];
    $str.=$name.", ";//converts to a string and puts a sep.
}

//mail********************************************** ************************************************** *********
$to = "$str";
$subject = 'two';
$message = "$html";

$headers = 'MIME-Version: 1.0' . "\/r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

mail($to, $subject, $message, $headers);
echo"$message";

mysql_free_result($result);
?>
 
Old March 1st, 2005, 06:15 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

hi,
In your $html is there any single quote('), please check that

surendran
(Anything is Possible)





Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML in email? larry HTML Code Clinic 2 May 1st, 2007 10:43 PM
Email HTML g2000 Classic ASP Basics 0 October 13th, 2005 11:28 AM
Embed Image in HTML Email cullancrothers Pro PHP 4 June 22nd, 2005 01:40 PM
email in html format alitoday HTML Code Clinic 3 June 19th, 2004 08:31 AM
Build HTML email from form jmccann Classic ASP Basics 2 July 22nd, 2003 09:47 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.