You are here: specifying a font in PHP-generated email « PHP « IT news, forums, messages
specifying a font in PHP-generated email

Posted by Kenn on 09/20/05 23:32

Greetings.

I'm attempting to create an HTML email via PHP and cannot get the email
to render in the correct font. I've made several stabs at it, the most
recent one below. The same code that works just fine on a web page
won't work for me here. What am I doing wrong?

Any and all help appreciated.

Kenn


<?php
$headers = "From: webserver@localhost\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$boundary = uniqid("HTMLDEMO");
$headers .= "Content-Type: multipart/alternative" .
"; boundary = $boundary\r\n\r\n";
$headers .= "This is a MIME encoded message.\r\n\r\n";
$headers .= "--$boundary\r\n" .
"Content-Type: text/plain; charset=ISO-8859-1\r\n" .
"Content-Transfer-Encoding: base64\r\n\r\n";
$headers .= chunk_split(base64_encode("This is the plain text version!"));
$headers .= "--$boundary\r\n" .
"Content-Type: text/html; charset=ISO-8859-1\r\n" .
"Content-Transfer-Encoding: base64\r\n\r\n";
$headers .= chunk_split(base64_encode("<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<style type=\"text/css\">
<!--
h1 {color: #000000;
font-family: \"verdana\" ; }
-->
</style>
</HEAD>
<BODY>
testing<br>
<h1>TESTING 222</h1> test over.
</BODY>
</HTML>
"));
//send message
mail("kenn@thebytebusiness.com", "Another HTML Message", "", $headers);
?>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация