I have built an html string that is used for 2 purposes:
- output to browser
- Send as a fully formatted email.
This script work perfect for sending email but not for outputting the the browser. Here is the basic build:
function makeformatedmessage(){
$message = '';
$message .= '
<html>
<head>
<title>Some title</title>
</head>
<body>';
$message .='complex html body';
$message .='complex html body 2';
$message .='</body>
</html>';
return $message;
}
When I send this as an email everything is sent but when i output to the browser only $message .='complex html body 2' part of the message is missing. Is there a better way to store html and output to the browser.
EDITED I descovered through closer debugging that there was a another file with the same function that was been called in the browser. After I removed it it worked as it should.
echo makeformatedmessage();) would work just fine.