<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Beaver6813.com &#187; updated</title>
	<atom:link href="http://beaver6813.com/tag/updated/feed/" rel="self" type="application/rss+xml" />
	<link>http://beaver6813.com</link>
	<description>Web Developer Extraordinaire!</description>
	<lastBuildDate>Thu, 05 Jan 2012 20:33:26 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-20304</generator>
		<item>
		<title>MultiPart E-Mail Code for PHP (Text and HTML)</title>
		<link>http://beaver6813.com/2009/11/multipart-e-mail-code-for-php-text-and-html/</link>
		<comments>http://beaver6813.com/2009/11/multipart-e-mail-code-for-php-text-and-html/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 15:53:26 +0000</pubDate>
		<dc:creator>Beaver6813</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[compatability]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[mime]]></category>
		<category><![CDATA[multipart]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[updated]]></category>

		<guid isPermaLink="false">http://beaver6813.com/?p=88</guid>
		<description><![CDATA[Whilst trawling through some of my ultra-old posts on various forums I&#8217;ve found this nifty little piece of code that enables you to send in both HTML and TEXT form. This is useful for clients that cant display HTML (they &#8230; <a href="http://beaver6813.com/2009/11/multipart-e-mail-code-for-php-text-and-html/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://beaver6813.com/2009/11/email-to-sms-email-to-mobile-free-database/' rel='bookmark' title='Email to SMS / Email to Mobile, Free Database'>Email to SMS / Email to Mobile, Free Database</a></li>
<li><a href='http://beaver6813.com/2010/03/godaddy-mod_rewrite-hell/' rel='bookmark' title='GoDaddy mod_rewrite Hell'>GoDaddy mod_rewrite Hell</a></li>
<li><a href='http://beaver6813.com/2010/06/php-tld-list-inc-level-2-3/' rel='bookmark' title='[PHP] TLD List, Inc. Level 2 &amp; 3'>[PHP] TLD List, Inc. Level 2 &#038; 3</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Whilst trawling through some of my ultra-old posts on various forums I&#8217;ve found this nifty little piece of code that enables you to send in both HTML and TEXT form. This is useful for clients that cant display HTML (they will display the text instead). I developed it back in 2007 so it may need updating but its a useful bit of code!<br />
<em>UPDATE: Peter Mills recently emailed me with a problem with this script and compatability with gmail, I have managed to fix this. It seems that gmails parser has gotten even more strict, there were stray line breaks where there shouldnt have been and the initial boundary declaration in the headers was not wrapped properly in double quotes! Cheers for finding this bug Peter and hopefully its all working again now!</em><br/></p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p88code2'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p882"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
</pre></td><td class="code" id="p88code2"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
Sam Cleaver aka Beaver6813 (http://www.beaver6813.com)
Mutlipart Email Script, Sends In Both Plain And HTML For Compatibility
Which Works With MIME 1.0+ Supporting Software.
Email: samcleaver.beaver[-at]gmail[-dot]com
Copyright (C) 2007  Beaver6813
Updated November 2009. Thanks to Peter Mills for his help in recognising
the recent problem the script had with GMail!
--------------------------------------------------------------
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
--------------------------------------------------------------
*/</span>
<span style="color: #666666; font-style: italic;">/*
 CHANGES:
 -- Is Now Compatible With GMail
 -- Encrypts Messages In Base64 For Easier Transportation
 -- 03/11/09 - Changed to work with changes in GMail, removed now unnecessary base64 encoding
 NOTES:
 -- From experience with different mail services i've discovered some key pointers
 when sending html or any type of email:
  * DO NOT link to external CSS stylesheets, most of the time these are either filtered out
  or do not load properly
  * As discovered in GMail it strips out any stylesheets completely, even inline ones so you're
  going to have to use the style='' tags on any div's etc you want to make look pretty
  * Bear in mind linking to any external resources will bring up a warning on the clients
  end and they can choose to or not to load external resources.
  * Keep HTML resources as simple as possible, most of the time they aren't loaded as well as
  they would in firefox and so can be really mucked up if you do some complicated magic with
  them.
 COMING SOON:
 -- Will be turned into a class making it easier to send emails :)
*/</span>
<span style="color: #666666; font-style: italic;"># Is the OS Windows or Mac or Linux
</span><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/strtoupper"><span style="color: #990000;">strtoupper</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">PHP_OS</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">'WIN'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$eol</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/strtoupper"><span style="color: #990000;">strtoupper</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">PHP_OS</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">'MAC'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$eol</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$eol</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$_emailer_subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;My First Email Yay!&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//The subject of the email... duh</span>
<span style="color: #000088;">$_emailer_to</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;sam@beaver6813.com&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//You can make this even easier for the</span>
 <span style="color: #666666; font-style: italic;">//email client by specifying the actual name of the person as well, but for</span>
 <span style="color: #666666; font-style: italic;">//simplicities sake we'll just give the email</span>
<span style="color: #000088;">$_emailer_from</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;test@localhost&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Again, you can do to this what</span>
<span style="color: #666666; font-style: italic;">//i said above</span>
<span style="color: #000088;">$_emailer_reply_to</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;test@localhost&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$_emailer_cc</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Optional</span>
<span style="color: #000088;">$_emailer_bcc</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//Optional</span>
<span style="color: #666666; font-style: italic;">//Okay what do you want to appear if it displays the plain text version?</span>
<span style="color: #000088;">$email_html</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;h1&gt;HTML E-mail&lt;/h1&gt;
&lt;p&gt;This is an &lt;b&gt;HTML&lt;/b&gt; e-mail.&lt;/p&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//Okay what do you want to appear if it displays the HTML version?</span>
<span style="color: #000088;">$email_plain</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;HTML E-mail<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>This is the text portion of an HTML e-mail<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">/* YOU NEED CONFIGURE NOTHING MORE!!!! (Apart from the respond at the very bottom of this script!) */</span>
<span style="color: #000088;">$_emailer_subject</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_emailer_subject</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">''</span> ? <span style="color: #0000ff;">'No Subject'</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$_emailer_subject</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Must have a subject</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_emailer_cc</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #000088;">$_emailer_cc_do</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Cc: &quot;</span><span style="color: #339933;">.</span><a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_emailer_cc</span> <span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span> <span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">2</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Remove the trailing &quot;, &quot;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_emailer_bcc</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #000088;">$_emailer_bcc_do</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Bcc: &quot;</span><span style="color: #339933;">.</span><a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_emailer_bcc</span> <span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span> <span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">2</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$_emailer_reply_to</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_emailer_reply_to</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">''</span> ? <span style="color: #000088;">$_emailer_from</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$_emailer_reply_to</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mid</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/md5"><span style="color: #990000;">md5</span></a><span style="color: #009900;">&#40;</span> <a href="http://www.php.net/uniqid"><span style="color: #990000;">uniqid</span></a><span style="color: #009900;">&#40;</span> <a href="http://www.php.net/time"><span style="color: #990000;">time</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Generate a unique id for the email</span>
<span style="color: #000088;">$host</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'www'</span> <span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span> <span style="color: #339933;">,</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_HOST'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Remove the www for an &quot;email address&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//add From: header</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;From: <span style="color: #006699; font-weight: bold;">$_emailer_from</span><span style="color: #006699; font-weight: bold;">$eol</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//specify MIME version 1.0</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Return-Path: <span style="color: #006699; font-weight: bold;">$_emailer_reply_to</span><span style="color: #006699; font-weight: bold;">$eol</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$_emailer_cc_do</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$_emailer_bcc_do</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;MIME-Version: 1.0<span style="color: #006699; font-weight: bold;">$eol</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Message-ID: &lt;<span style="color: #006699; font-weight: bold;">$mid</span>@<span style="color: #006699; font-weight: bold;">$host</span>&gt;<span style="color: #006699; font-weight: bold;">$eol</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;X-Priority: 3<span style="color: #006699; font-weight: bold;">$eol</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;X-MSMail-Priority: Normal<span style="color: #006699; font-weight: bold;">$eol</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;X-Mailer: PHP<span style="color: #006699; font-weight: bold;">$eol</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;X-MimeOLE: Generated By Beaver6813s MultiPart Mail Script<span style="color: #006699; font-weight: bold;">$eol</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Date: &quot;</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/gmdate"><span style="color: #990000;">gmdate</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'D, d M Y H:i:s Z'</span> <span style="color: #339933;">,</span> <a href="http://www.php.net/time"><span style="color: #990000;">time</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$eol</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//unique boundary this can be whatever you want... but try and make it imaginative :)</span>
<span style="color: #000088;">$boundary</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/uniqid"><span style="color: #990000;">uniqid</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;BEAVER6813&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//tell e-mail client this e-mail contains//alternate versions</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Content-type: multipart/alternative; boundary=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">$boundary</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//plain text version of message</span>
<span style="color: #000088;">$body</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;--<span style="color: #006699; font-weight: bold;">$boundary</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;Content-Type: text/plain; charset=<span style="color: #000099; font-weight: bold;">\&quot;</span>iso-8859-1<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;Content-transfer-encoding: 8bit&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$body</span> <span style="color: #339933;">.=</span> <a href="http://www.php.net/chunk_split"><span style="color: #990000;">chunk_split</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$email_plain</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//HTML version of message</span>
<span style="color: #000088;">$body</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;--<span style="color: #006699; font-weight: bold;">$boundary</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;Content-Type: text/html; charset=<span style="color: #000099; font-weight: bold;">\&quot;</span>iso-8859-1<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;Content-Transfer-Encoding: quoted-printable&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$body</span> <span style="color: #339933;">.=</span> <a href="http://www.php.net/chunk_split"><span style="color: #990000;">chunk_split</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$email_html</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;"># Finished
</span><span style="color: #000088;">$body</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;--<span style="color: #006699; font-weight: bold;">$boundary</span>--&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">.</span><span style="color: #000088;">$eol</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// finish with two eol's for better security.</span>
<span style="color: #666666; font-style: italic;">//send message</span>
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mail"><span style="color: #990000;">mail</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_emailer_to</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_emailer_subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #339933;">,</span> <span style="color: #000088;">$headers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;MAIL SENT SUCCESSFULLY. YOU'RE A WINNER!&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;SOME WEIRD ERROR :S. YOU LOSE&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Related posts:<ol>
<li><a href='http://beaver6813.com/2009/11/email-to-sms-email-to-mobile-free-database/' rel='bookmark' title='Email to SMS / Email to Mobile, Free Database'>Email to SMS / Email to Mobile, Free Database</a></li>
<li><a href='http://beaver6813.com/2010/03/godaddy-mod_rewrite-hell/' rel='bookmark' title='GoDaddy mod_rewrite Hell'>GoDaddy mod_rewrite Hell</a></li>
<li><a href='http://beaver6813.com/2010/06/php-tld-list-inc-level-2-3/' rel='bookmark' title='[PHP] TLD List, Inc. Level 2 &amp; 3'>[PHP] TLD List, Inc. Level 2 &#038; 3</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://beaver6813.com/2009/11/multipart-e-mail-code-for-php-text-and-html/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

