email with style (again)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ok gang:

What's wrong with the following code?

It sends the email OK, but nothing is styled.

Where did I go wrong?

Thanks,

tedd

--- code

<?php

$to = "tedd.sperling@xxxxxxxxx";
$body = make_mail();
$subject = "Subject";
$fromaddress = "tedd@xxxxxxxxxxxx";
$fromname = "tedd";

send_mail($to, $body, $subject, $fromaddress, $fromname, $attachments=false);

echo('Email sent');

?>


<?php

function make_mail()
{
$message = <<<EOT

<span style="font-weight: bold;">Title:</span> A title of something
<span style="font-weight: bold;">Presenter:</span> By someone

tedd

EOT;
return $message;
}

function send_mail($to, $body, $subject, $fromaddress, $fromname, $attachments=false)
{
$eol="\r\n";

// Common Headers
$headers .= "From: ".$fromname."<".$fromaddress.">".$eol;
$headers .= "Reply-To: ".$fromname."<".$fromaddress.">".$eol;
$headers .= "Return-Path: ".$fromname."<".$fromaddress.">".$eol;
$headers .= "Message-ID: <".time()."-".$fromaddress.">".$eol;
$headers .= "X-Mailer: PHP v".phpversion().$eol;

// HTML Version
$msg .= "Content-Type: text/html; charset=iso-8859-1".$eol;
$msg .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
$msg .= $body.$eol.$eol;

// SEND THE EMAIL
ini_set(sendmail_from,$fromaddress);
$mail_sent = mail($to, $subject, $msg, $headers);

ini_restore(sendmail_from);

return $mail_sent;
}
?>
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux