Jump to content

HTML formatted text sent by mail() showing HTML source code, not rendered!?


physaux

Recommended Posts

Here is the code I based my email on. It is going to be set to a daily cron to send me updates. I have a whole variable of information, called $output, which, when I ECHO, comes out nice on my page. I now tried to send that value in an email, however it appears in my email not "formatted", but I see all the raw html code.

 

$to      = '[email protected]';
$subject = 'the subject';
$message = $output;
$headers = 'From: [email protected]' . "\r\n" .
    'Reply-To: [email protected]';

mail($to, $subject, $message, $headers);

 

Does anyone know if it is possible for me to get the output I want?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.