NicksterFL Posted September 21, 2006 Share Posted September 21, 2006 is there anyway i can insert the contents of a php page into the body of an email?can someone post a simple example. Need to basically scrape a page and insert the page contents into the body section of an email that's being sent via php. Quote Link to comment Share on other sites More sharing options...
AdRock Posted September 21, 2006 Share Posted September 21, 2006 what do you want to put in the email? Quote Link to comment Share on other sites More sharing options...
warewolfe Posted September 21, 2006 Share Posted September 21, 2006 Hi, how are you planning in getting the page in the first place? Is it a page you are getting from the net or one you are generating in the first place? The second is a lot easier than the first. Quote Link to comment Share on other sites More sharing options...
Skatecrazy1 Posted September 22, 2006 Share Posted September 22, 2006 [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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.