Jump to content

insert contenst of php page into body of email


NicksterFL

Recommended Posts

[code]
<?php
//name your file either through root path or whatever
$filename = "your_php_file_name_here.php";
//open the file
$file = fopen($file, "r");
//get the php file's size
$filesize = filesize($filename);
//read the file and put contents into a variable
$code = fread($file, $filesize);
fclose($file);
//then you can take your code variable and put it into your mail form
?>

<form method="post" action="mailer_script_filename.php">
Message:<textarea rows="20" cols="25" name="newmsg">
<?php echo $code; ?>
</textarea>
<br />
<input type="submit" value="send email">
</form>

[/code]

i'm not sure, but if your mailer script gets parse errors then just do

[code]
$code = addslashes($code);
[/code]

but it probably won't, so disregard that last little snippet unless you get errors
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.