Making my html doc to html mail

Does anyone know anything out there that can make my webmail that I’ve designed as a web page to make it work as a html mail?
Since some rules and codes and links is handled a bit different it would be nice to copy and paste the code I have and get it out as a working code for my e-mail that I would like to send.

Anyone have any ideas? Right now I make a web page for those who can’t read html in their e-mail (so they can click on a link), but when I want to include my message, images, links aso I put the code with the head tags, then first part of the message, then a new part including a link, then the rest of the message, another image, another link…

It looks something like this:


$to = $row_rs_send['email'];
$subject = "SUBJECT OF MAIL";

$headstart = '<html><head><title>MY NEWSLETTER</title></head><body>';

$stilmall = '<style type="text/css" media="screen">
      body {
         margin: 0;
         padding: 0;
         background-color: #ffffff;
      }

      td.permission {
         padding: 20px 0 20px 0;
      } 
and so on...

$headpart2 = '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td align="center"><table width="580" border="0" cellspacing="0" cellpadding="0"><tr><td class="permission" align="center"><p>Having trouble reading this email? View it in your browser by clicking <a href="';
			   
$troublelink = 'http://www.mysite.com/webmail/nov2010.php?code=';
$troublecode = $row_rs_send['code'];

$headpart = '" target="_blank">HERE</a>.</p></td></tr><tr><td class="header" align="left" valign="bottom"><img src="http://www.mysite.com/webmail/header.jpg" alt="MySite" width="580" height="130" /></td></tr><tr><td><table width="580" height="130" border="0" cellspacing="16" cellpadding="0" class="content"><tr><td class="mainbar" align="left" valign="top" width="580"><h3>';
						   
$sendmonth = 'November 2010</h3>';

$text1 = '<h2>Headline</h2><p><img src="http://www.mysite.com/webmail/main-content-inline-pix_144.jpg" alt="ImageTitle" width="144" height="144" border="1" align="right" />Some text</p>
<p>More text. And click if you want to.<a href="';

$listen = 'http://www.mysite.com/file/click1.php?code=';
$listencode = $row_rs_send['code'];

$text3 = '"><br><br>CLICK HERE TO SEE THIS</a>';

Well, it’s something like that and very easy to get into trouble when chancing the content. So, it would be great to find a page that could make my webpage to a working code for this. Any ideas?