Jump to content

Recommended Posts

it goes like this....

 

$to = $emailer;

$sender = "Daisy Toys<newsletter@daisytoys.com>";

$subject = "Daisy Toys Newsletter for - $company";

$message = "<HTML>

<head>

///////////other html Stuff

<?php require( dirname( __FILE__ ) . '/../../folder/file.html' );

</BODY>

</HTML>";

mail($emailer, $subject, "", $headers); 

Link to comment
https://forums.phpfreaks.com/topic/253142--/#findComment-1297791
Share on other sites

Try

 

<?php

$to = $emailer;
$sender = "Daisy Toys<newsletter@daisytoys.com>";
$subject = "Daisy Toys Newsletter for - $company";
$message = "<HTML><head>///////////other html Stuff " . require("filelocation.php") . "</BODY></HTML>";
mail($emailer, $subject, "", $headers);  

?>

Link to comment
https://forums.phpfreaks.com/topic/253142--/#findComment-1297795
Share on other sites

Could someone tell why isn't this working?

 

<?php
//other php functions
?>
$message = "<HTML>
email body section A
<?php require( dirname( __FILE__ ) . '/../../folder/file.php' ); ?>//this is my problem - it's SHOWING BLANK here (the path is correct)
email body section B
</HTML>"

Link to comment
https://forums.phpfreaks.com/topic/253142--/#findComment-1297856
Share on other sites

Require pulls php code or html into the php script.  It does not read it as a string into a variable.  Use file_get_contents

 

$body = file_get_contents('path/to/file/filename');
$message = "
email body section A 
$body
email body section B
";

Link to comment
https://forums.phpfreaks.com/topic/253142--/#findComment-1297991
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.