Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To 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 December 27th, 2006, 04:08 AM
Registered User
 
Join Date: Dec 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default mail( ) with file_get_contents( )

I have Message.htm

Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>’Mesaage</title>
<style type="text/css">
</style></head>

<body>
<table width="100%"  border="1" cellpadding="1" cellspacing="1">
  <tr>
    <td width="83%"><div align="right" class="TEXT"> <? echo $name; ?> </div></td>
    <td width="17%"><div align="right">
      <p>name</p>
    </div></td>
  </tr>
</table>
</body>
</html>
and file.php
Code:
<?
$name = "MAN";
//...........
//...........
$mail_content = file_get_contents('Message.htm');
mail($to, $subject, $mail_content, $headers);
?>
how let ( <? echo $name; ?> ) work in the mail function???






 
Old December 29th, 2006, 01:04 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 mtz1406,
try to send like this

<?php
$name = "MAN";
$mail_content='<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>�Mesaage</title>
<style type="text/css">
</style></head>

<body>
<table width="100%" border="1" cellpadding="1" cellspacing="1">
  <tr>
    <td width="83%"><div align="right" class="TEXT"> " . $name ." </div></td>
    <td width="17%"><div align="right">
      <p>name</p>
    </div></td>
  </tr>
</table>
</body>
</html>';


//...........
//...........
mail($to, $subject, $mail_content, $headers);
?>

surendran
(Anything is Possible)
http://ssuren.spaces.msn.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Send mail and attachments with PHP mail function Lofa Beginning PHP 1 June 2nd, 2008 03:24 PM
problems sending mail with java mail gandacuboy J2EE 2 December 20th, 2006 03:05 PM
Sending e-mail to different mail box! Calibus Classic ASP Databases 4 September 3rd, 2004 05:48 PM
Sending both text mail and HTML mail - CDONTS madhukp Classic ASP Basics 1 October 8th, 2003 01:05 AM





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